void logRaw(Severity severity, TArg&& arg, TArgs&&... args) { if (canLog(severity)) { m_core->log(LogCore::ClaimPolicy::Block, severity, log11_detail::decayArgument(arg), log11_detail::decayArgument(args)...); } }
void log(Severity severity, const char* message, TArgs&&... args) { if (canLog(severity)) { m_core->log(LogCore::ClaimPolicy::Block, severity, log11_detail::makeFormatTuple( message, log11_detail::decayArgument(args)...)); } }
void log(may_truncate_or_discard_t, Severity severity, const char* message, TArgs&&... args) { if (canLog(severity)) { m_core->log(LogCore::ClaimPolicy::Truncate, severity, log11_detail::makeFormatTuple( message, log11_detail::decayArgument(args)...)); } }
void VisualLog::flushLine(){ if ( canLog() ){ QString pref = prefix(); if ( m_output & VisualLog::Console ) vLoggerConsole(pref + m_buffer + "\n"); if ( m_output & VisualLog::File ) flushFile(pref + m_buffer + "\n"); if ( m_output & VisualLog::View && m_model ) m_model->onMessage(m_configuration, m_messageInfo, m_buffer); if ( m_output & VisualLog::Extensions ) flushHandler(m_buffer); m_buffer = ""; } }
void Log::logDirect(LogLevel level, const char *file, int line, const QString &msg) { if (!canLog(level)) { return; } char prettyFile[40]; // truncated file name truncateFileName(prettyFile, 40, file); QString header = "%1 | %2 | %3 | %4\n"; QString logLine = header.arg(levelToString(level)).arg(prettyFile).arg(line, 4).arg(msg); this->write(logLine); if (level == LogLevel::Fatal) { abort(); } }
void VisualLog::asView(const QString &viewPath, std::function<QVariant ()> cloneFunction){ if ( canLog() && m_objectOutput && (m_output & VisualLog::View) ){ m_model->onView(m_configuration, m_messageInfo, viewPath, cloneFunction()); m_output = removeOutputFlag(m_output, VisualLog::View); } }
void VisualLog::asView(const QString &viewPath, const QVariant &viewData){ if ( canLog() && m_objectOutput && (m_output & VisualLog::View) ){ m_model->onView(m_configuration, m_messageInfo, viewPath, viewData); m_output = removeOutputFlag(m_output, VisualLog::View); } }