aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2014-12-12 11:10:45 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-01-15 17:06:56 +0100
commit4426aa4055f75621f2b884a4ed5ab224ab0632da (patch)
tree0e0ec6872982c6233c639955339e01d951cfda2f /src/qml/qml/v8/qqmlbuiltinfunctions.cpp
parent2a2fb6a9b4ff9b387e3301c76d7d62dcc4d604f5 (diff)
Redirect console.info to new QtInfoMsg
Change-Id: I6f4560a3baae16dd6db090d51a577060689825ef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qqmlbuiltinfunctions.cpp')
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 6cb7990dd6..9cf9ba9c12 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -1282,7 +1282,7 @@ QV4::Heap::ConsoleObject::ConsoleObject(ExecutionEngine *v4)
o->defineDefaultProperty(QStringLiteral("debug"), QV4::ConsoleObject::method_log);
o->defineDefaultProperty(QStringLiteral("log"), QV4::ConsoleObject::method_log);
- o->defineDefaultProperty(QStringLiteral("info"), QV4::ConsoleObject::method_log);
+ o->defineDefaultProperty(QStringLiteral("info"), QV4::ConsoleObject::method_info);
o->defineDefaultProperty(QStringLiteral("warn"), QV4::ConsoleObject::method_warn);
o->defineDefaultProperty(QStringLiteral("error"), QV4::ConsoleObject::method_error);
o->defineDefaultProperty(QStringLiteral("assert"), QV4::ConsoleObject::method_assert);
@@ -1299,6 +1299,7 @@ QV4::Heap::ConsoleObject::ConsoleObject(ExecutionEngine *v4)
enum ConsoleLogTypes {
Log,
+ Info,
Warn,
Error
};
@@ -1361,6 +1362,10 @@ static QV4::ReturnedValue writeToConsole(ConsoleLogTypes logType, CallContext *c
if (loggingCategory.isDebugEnabled())
logger.debug("%s", result.toUtf8().constData());
break;
+ case Info:
+ if (loggingCategory.isInfoEnabled())
+ logger.info("%s", result.toUtf8().constData());
+ break;
case Warn:
if (loggingCategory.isWarningEnabled())
logger.warning("%s", result.toUtf8().constData());
@@ -1385,11 +1390,15 @@ QV4::ReturnedValue ConsoleObject::method_log(CallContext *ctx)
{
//console.log
//console.debug
- //console.info
//print
return writeToConsole(Log, ctx);
}
+QV4::ReturnedValue ConsoleObject::method_info(CallContext *ctx)
+{
+ return writeToConsole(Info, ctx);
+}
+
QV4::ReturnedValue ConsoleObject::method_profile(CallContext *ctx)
{
QV4::ExecutionEngine *v4 = ctx->d()->engine;