mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-11 17:24:27 +00:00
Improve log format in StatusIm and add timestamps
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
2c85d70e48
commit
486d4684b8
@ -325,23 +325,27 @@ void saveMessage(QtMsgType type, const QMessageLogContext &context,
|
|||||||
|
|
||||||
QByteArray localMsg = msg.toLocal8Bit();
|
QByteArray localMsg = msg.toLocal8Bit();
|
||||||
QString message = localMsg + "\n";
|
QString message = localMsg + "\n";
|
||||||
|
QString timestamp = QDateTime::currentDateTime().toString("hh:mm:ss.zzz");
|
||||||
|
QString typeStr;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QtDebugMsg:
|
case QtDebugMsg:
|
||||||
appendConsoleString(QString("Debug: %1 \n").arg(message));
|
typeStr = "D";
|
||||||
break;
|
break;
|
||||||
case QtInfoMsg:
|
case QtInfoMsg:
|
||||||
appendConsoleString(QString("Info: %1 \n").arg(message));
|
typeStr = "I";
|
||||||
break;
|
break;
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
appendConsoleString(QString("Warning: %1 \n").arg(message));
|
typeStr = "W";
|
||||||
break;
|
break;
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
appendConsoleString(QString("Critical: %1 \n").arg(message));
|
typeStr = "C";
|
||||||
break;
|
break;
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
|
typeStr = "F";
|
||||||
appendConsoleString(QString("Fatal: %1 \n").arg(message));
|
}
|
||||||
|
appendConsoleString(QString("%1 - %2 - %3").arg(timestamp, typeStr, message));
|
||||||
|
if (type == QtFatalMsg) {
|
||||||
writeLogsToFile();
|
writeLogsToFile();
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ check_sync() {
|
|||||||
read response;
|
read response;
|
||||||
if [ "$response" = "reset" ]; then
|
if [ "$response" = "reset" ]; then
|
||||||
git fetch $REMOTE
|
git fetch $REMOTE
|
||||||
|
git checkout $BRANCH
|
||||||
git reset --hard $REMOTE/$BRANCH
|
git reset --hard $REMOTE/$BRANCH
|
||||||
else
|
else
|
||||||
fatal "the local branch $BRANCH is behind $REMOTE/$BRANCH."
|
fatal "the local branch $BRANCH is behind $REMOTE/$BRANCH."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user