Skip to content

Commit

Permalink
Console API: Add console.info
Browse files Browse the repository at this point in the history
Add console.info for the sake of completeness. It's mapped to qDebug(),
just like console.log, console.debug, print.

Change-Id: Ife1cfbfe810d4e5e9175343778dff734a56f4a80
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
  • Loading branch information
Kai Koehne authored and Qt by Nokia committed Jan 16, 2012
1 parent 04f06f3 commit 7911627
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/src/declarative/qdeclarativedebugging.qdoc
Expand Up @@ -34,7 +34,7 @@

\section2 Log

\c console.log, console.debug, console.warn and console.error can be used to print
\c console.log, console.debug, console.info, console.warn and console.error can be used to print
debugging information to the console. For example:

\qml
Expand Down
1 change: 1 addition & 0 deletions src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp
Expand Up @@ -152,6 +152,7 @@ v8::Handle<v8::Value> consoleLog(const v8::Arguments &args)
{
//console.log
//console.debug
//console.info
//print
return console(Log, args);
}
Expand Down
6 changes: 4 additions & 2 deletions src/declarative/qml/v8/qv8engine.cpp
Expand Up @@ -530,14 +530,16 @@ void QV8Engine::initializeGlobal(v8::Handle<v8::Object> global)
v8::Local<v8::Function> consoleLogFn = V8FUNCTION(consoleLog, this);

console->Set(v8::String::New("debug"), consoleLogFn);
console->Set(v8::String::New("error"), V8FUNCTION(consoleError, this));
console->Set(v8::String::New("log"), consoleLogFn);
console->Set(v8::String::New("info"), consoleLogFn);
console->Set(v8::String::New("warn"), V8FUNCTION(consoleWarn, this));
console->Set(v8::String::New("error"), V8FUNCTION(consoleError, this));

console->Set(v8::String::New("profile"), V8FUNCTION(consoleProfile, this));
console->Set(v8::String::New("profileEnd"), V8FUNCTION(consoleProfileEnd, this));
console->Set(v8::String::New("time"), V8FUNCTION(consoleTime, this));
console->Set(v8::String::New("timeEnd"), V8FUNCTION(consoleTimeEnd, this));
console->Set(v8::String::New("trace"), V8FUNCTION(consoleTrace, this));
console->Set(v8::String::New("warn"), V8FUNCTION(consoleWarn, this));

v8::Local<v8::Object> qt = v8::Object::New();

Expand Down
Expand Up @@ -47,6 +47,7 @@ QtObject {
Component.onCompleted: {
console.debug("console.debug");
console.log("console.log");
console.info("console.info");
console.warn("console.warn");
console.error("console.error");

Expand Down
Expand Up @@ -65,6 +65,7 @@ void tst_qdeclarativeconsole::logging()

QTest::ignoreMessage(QtDebugMsg, "console.debug");
QTest::ignoreMessage(QtDebugMsg, "console.log");
QTest::ignoreMessage(QtDebugMsg, "console.info");
QTest::ignoreMessage(QtWarningMsg, "console.warn");
QTest::ignoreMessage(QtCriticalMsg, "console.error");

Expand Down

0 comments on commit 7911627

Please sign in to comment.