Improve log format in StatusIm and add timestamps

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2018-09-14 17:30:31 +02:00
parent 2c85d70e48
commit 486d4684b8
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
2 changed files with 11 additions and 6 deletions

View File

@ -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();
}

View File

@ -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."