Changeset 2d84891 in subsurface


Ignore:
Timestamp:
Jun 11, 2017, 1:55:41 PM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
3b993fba
Parents:
0ea6f13
git-author:
Dirk Hohndel <dirk@…> (06/05/17 19:56:52)
git-committer:
Dirk Hohndel <dirk@…> (06/11/17 13:55:41)
Message:

Make message handler write to console as well

This way we can see the debug output even if the app is hung or crashes.

Signed-off-by: Dirk Hohndel <dirk@…>

Location:
qt-models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qt-models/messagehandlermodel.cpp

    r0ea6f13 r2d84891  
     1// SPDX-License-Identifier: GPL-2.0
    12#include "messagehandlermodel.h"
     3
     4/* based on logging bits from libdivecomputer */
     5#ifndef __ANDROID__
     6#define INFO(fmt, ...)  fprintf(stderr, "INFO: " fmt "\n", ##__VA_ARGS__)
     7#else
     8#include <android/log.h>
     9#define INFO(fmt, ...)  __android_log_print(ANDROID_LOG_DEBUG, __FILE__, "INFO: " fmt "\n", ##__VA_ARGS__)
     10#endif
    211
    312void logMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
     
    3140        m_data.append({message, type});
    3241        endInsertRows();
     42        INFO("%s", message.toUtf8().constData());
    3343}
    3444
  • qt-models/messagehandlermodel.h

    r0ea6f13 r2d84891  
     1// SPDX-License-Identifier: GPL-2.0
    12#ifndef MESSAGEHANDLERMODEL_H
    23#define MESSAGEHANDLERMODEL_H
Note: See TracChangeset for help on using the changeset viewer.