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();
|
||||
QString message = localMsg + "\n";
|
||||
QString timestamp = QDateTime::currentDateTime().toString("hh:mm:ss.zzz");
|
||||
QString typeStr;
|
||||
|
||||
switch (type) {
|
||||
case QtDebugMsg:
|
||||
appendConsoleString(QString("Debug: %1 \n").arg(message));
|
||||
typeStr = "D";
|
||||
break;
|
||||
case QtInfoMsg:
|
||||
appendConsoleString(QString("Info: %1 \n").arg(message));
|
||||
typeStr = "I";
|
||||
break;
|
||||
case QtWarningMsg:
|
||||
appendConsoleString(QString("Warning: %1 \n").arg(message));
|
||||
typeStr = "W";
|
||||
break;
|
||||
case QtCriticalMsg:
|
||||
appendConsoleString(QString("Critical: %1 \n").arg(message));
|
||||
typeStr = "C";
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
|
||||
appendConsoleString(QString("Fatal: %1 \n").arg(message));
|
||||
typeStr = "F";
|
||||
}
|
||||
appendConsoleString(QString("%1 - %2 - %3").arg(timestamp, typeStr, message));
|
||||
if (type == QtFatalMsg) {
|
||||
writeLogsToFile();
|
||||
abort();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ check_sync() {
|
|||
read response;
|
||||
if [ "$response" = "reset" ]; then
|
||||
git fetch $REMOTE
|
||||
git checkout $BRANCH
|
||||
git reset --hard $REMOTE/$BRANCH
|
||||
else
|
||||
fatal "the local branch $BRANCH is behind $REMOTE/$BRANCH."
|
||||
|
|
Loading…
Reference in New Issue