62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#include <myx/backports/qt/common.hpp>
|
|
#include <myx/core/config.hpp>
|
|
|
|
#include <myx/qt/message_logger_syslog.hpp>
|
|
|
|
#include <syslog.h>
|
|
|
|
namespace myx {
|
|
|
|
namespace qt {
|
|
|
|
MessageLoggerSyslog::MessageLoggerSyslog() :
|
|
MessageLogger()
|
|
{
|
|
// openlog( nullptr, LOG_ODELAY, LOG_USER );
|
|
}
|
|
|
|
|
|
MessageLoggerSyslog::~MessageLoggerSyslog() noexcept ( true )
|
|
{
|
|
closelog();
|
|
}
|
|
|
|
|
|
void MessageLoggerSyslog::debug( const QMessageLogContext& context, const QString& msg )
|
|
{
|
|
Q_UNUSED( context )
|
|
syslog( LOG_DEBUG, "%s\n", msg.toUtf8().data() );
|
|
}
|
|
|
|
|
|
void MessageLoggerSyslog::info( const QMessageLogContext& context, const QString& msg )
|
|
{
|
|
Q_UNUSED( context )
|
|
syslog( LOG_INFO, "%s\n", msg.toUtf8().data() );
|
|
}
|
|
|
|
|
|
void MessageLoggerSyslog::warning( const QMessageLogContext& context, const QString& msg )
|
|
{
|
|
Q_UNUSED( context )
|
|
syslog( LOG_WARNING, "%s\n", msg.toUtf8().data() );
|
|
}
|
|
|
|
|
|
void MessageLoggerSyslog::critical( const QMessageLogContext& context, const QString& msg )
|
|
{
|
|
Q_UNUSED( context )
|
|
syslog( LOG_CRIT, "%s\n", msg.toUtf8().data() );
|
|
}
|
|
|
|
|
|
void MessageLoggerSyslog::fatal( const QMessageLogContext& context, const QString& msg )
|
|
{
|
|
Q_UNUSED( context )
|
|
syslog( LOG_EMERG, "%s\n", msg.toUtf8().data() );
|
|
}
|
|
|
|
} // namespace qt
|
|
|
|
} // namespace myx
|