Showing the changes to libraries/script-engine/src/ConsoleScriptingInterface.h (1 of 15 files). Show all
Unified · Split
| @@ -2,12 +2,14 @@ · 1 unmodified line | ||
| 2 | 2 | // ConsoleScriptingInterface.h |
| 3 | 3 | // libraries/script-engine/src |
| 4 | 4 | // |
| 5 | −// Created by volansystech on 6/1/17. | |
| 5 | +// Created by NeetBhagat on 6/1/17. | |
| 6 | 6 | // Copyright 2014 High Fidelity, Inc. |
| 7 | 7 | // |
| 8 | −// ConsoleScriptingInterface is responsible to print log. | |
| 9 | −// using "console" object on debug Window and Logs/log file with proper tags. | |
| 10 | −// Used in Javascripts file. | |
| 8 | +// ConsoleScriptingInterface is responsible for following functionality | |
| 9 | +// Printing logs with various tags and grouping on debug Window and Logs/log file. | |
| 10 | +// Debugging functionalities like Timer start-end, assertion, trace. | |
| 11 | +// To use these functionalities, use "console" object in Javascript files. | |
| 12 | +// For examples please refer "scripts/developer/tests/consoleObjectTest.js" | |
| 11 | 13 | // |
| 12 | 14 | // Distributed under the Apache License, Version 2.0. |
| 13 | 15 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| @@ -17,17 +19,13 @@ · 3 unmodified lines | ||
| 17 | 19 | #ifndef hifi_ConsoleScriptingInterface_h |
| 18 | 20 | #define hifi_ConsoleScriptingInterface_h |
| 19 | 21 | |
| 20 | − | |
| 21 | 22 | #include <QtCore/QObject> |
| 22 | 23 | #include <QtCore/QString> |
| 23 | 24 | #include <QtScript/QScriptable> |
| 24 | −#include <QHash> | |
| 25 | −#include "EntityEditFilters.h" | |
| 26 | −#include <QUrl> | |
| 27 | 25 | #include <QList> |
| 26 | +#include <QHash> | |
| 28 | 27 | |
| 29 | − | |
| 30 | −/// Scriptable interface of console object. Used exclusively in the JavaScript API | |
| 28 | +// Scriptable interface of "console" object. Used exclusively in the JavaScript API | |
| 31 | 29 | class ConsoleScriptingInterface : public QObject, protected QScriptable { |
| 32 | 30 | Q_OBJECT |
| 33 | 31 | public slots: |
| @@ -38,29 +36,17 @@ public slots: · 4 unmodified lines | ||
| 38 | 36 | void error(QString message); |
| 39 | 37 | void exception(QString message); |
| 40 | 38 | void time(QString labelName); |
| 41 | − void timeEnd(QString labelName); | |
| 39 | + void timeEnd(QString labelName); | |
| 42 | 40 | void asserts(bool condition, QString message = ""); |
| 43 | 41 | void trace(); |
| 44 | − void clear(); | |
| 42 | + void clear(); | |
| 45 | 43 | void group(QString groupName); |
| 46 | − void groupCollapsed(QString groupName); | |
| 47 | − void groupEnd(); | |
| 48 | − void consoleGroupLog(QString currentGroup, QString groupName); | |
| 49 | −public: | |
| 50 | − QString secondsToString(qint64 seconds); | |
| 51 | − bool hasCorrectSyntax(QScriptProgram& program); | |
| 52 | − QString hadUncaughtExceptions(QScriptEngine& engine, QString& fileName); | |
| 44 | + void groupCollapsed(QString groupName); | |
| 45 | + void groupEnd(); | |
| 53 | 46 | private: |
| 54 | − QHash<QString, QDateTime> _listOfTimeValues; | |
| 55 | − const qint64 DAY = 86400; | |
| 56 | − const QString TIME_FORMAT = "yyyy-MM-dd HH:mm"; | |
| 57 | − QString _selectedGroup; | |
| 58 | − const QString GROUP = "group"; | |
| 59 | − const QString GROUPCOLLAPSED = "groupCollapse"; | |
| 60 | − const QString GROUPEND = "groupEnd"; | |
| 61 | − bool _isSameLevel = false; | |
| 62 | − QString _addSpace = ""; | |
| 63 | − bool _isGroupEnd = true; | |
| 47 | + QHash<QString, QDateTime> _timerDetails; | |
| 48 | + QList<QString> _groupDetails; | |
| 49 | + void logGroupMessage(QString msg); | |
| 64 | 50 | }; |
| 65 | 51 | |
| 66 | 52 | #endif // hifi_ConsoleScriptingInterface_h |