aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-01-16 13:44:34 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-16 15:07:33 +0100
commit7911627f718d0e4876c42adbb5f3e02cf3c9f4eb (patch)
tree158d79a4b4f17a2a63a4aaa6d018556871e8e188
parent04f06f35a99cf83dd573718816a016345aa439dc (diff)
Console API: Add console.info
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>
-rw-r--r--doc/src/declarative/qdeclarativedebugging.qdoc2
-rw-r--r--src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp1
-rw-r--r--src/declarative/qml/v8/qv8engine.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativeconsole/data/logging.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeconsole/tst_qdeclarativeconsole.cpp1
5 files changed, 8 insertions, 3 deletions
diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc
index b25576d498..407d2f56a2 100644
--- a/doc/src/declarative/qdeclarativedebugging.qdoc
+++ b/doc/src/declarative/qdeclarativedebugging.qdoc
@@ -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
diff --git a/src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp b/src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp
index 5153043dc9..e2cda8fafb 100644
--- a/src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp
+++ b/src/declarative/qml/v8/qdeclarativebuiltinfunctions.cpp
@@ -152,6 +152,7 @@ v8::Handle<v8::Value> consoleLog(const v8::Arguments &args)
{
//console.log
//console.debug
+ //console.info
//print
return console(Log, args);
}
diff --git a/src/declarative/qml/v8/qv8engine.cpp b/src/declarative/qml/v8/qv8engine.cpp
index ef65398859..448734638f 100644
--- a/src/declarative/qml/v8/qv8engine.cpp
+++ b/src/declarative/qml/v8/qv8engine.cpp
@@ -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();
diff --git a/tests/auto/declarative/qdeclarativeconsole/data/logging.qml b/tests/auto/declarative/qdeclarativeconsole/data/logging.qml
index 3b3f94613b..b141d7c988 100644
--- a/tests/auto/declarative/qdeclarativeconsole/data/logging.qml
+++ b/tests/auto/declarative/qdeclarativeconsole/data/logging.qml
@@ -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");
diff --git a/tests/auto/declarative/qdeclarativeconsole/tst_qdeclarativeconsole.cpp b/tests/auto/declarative/qdeclarativeconsole/tst_qdeclarativeconsole.cpp
index 48e9481929..f806d13a24 100644
--- a/tests/auto/declarative/qdeclarativeconsole/tst_qdeclarativeconsole.cpp
+++ b/tests/auto/declarative/qdeclarativeconsole/tst_qdeclarativeconsole.cpp
@@ -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");