diff options
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 6b90a47388..e525869733 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -197,7 +197,7 @@ static bool willLogToConsole() # elif defined(Q_OS_UNIX) // if /dev/tty exists, we can only open it if we have a controlling TTY int devtty = qt_safe_open("/dev/tty", O_RDONLY); - if (devtty == -1 && (errno == ENOENT || errno == EPERM)) { + if (devtty == -1 && (errno == ENOENT || errno == EPERM || errno == ENXIO)) { // no /dev/tty, fall back to isatty on stderr return isatty(STDERR_FILENO); } else if (devtty != -1) { @@ -1445,12 +1445,14 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con now.start(); uint ms = now.msecsSinceReference(); message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000))); +#if QT_CONFIG(datestring) } else if (timeFormat.isEmpty()) { message.append(QDateTime::currentDateTime().toString(Qt::ISODate)); } else { message.append(QDateTime::currentDateTime().toString(timeFormat)); +#endif // QT_CONFIG(datestring) } -#endif +#endif // !QT_BOOTSTRAPPED } else if (token == ifCategoryTokenC) { if (!context.category || (strcmp(context.category, "default") == 0)) skip = true; |