SilentEye 0.4.1
|
Provides methods for multi-level logging into logfile and console. More...
#include <logger.h>
Public Types | |
enum | LogLevel { DEBUG_LEVEL = 1, INFO_LEVEL = 5, WARNING_LEVEL = 10, ERROR_LEVEL = 15 } |
Public Member Functions | |
Logger (QObject *parent=0) | |
Logger (QString className) | |
~Logger () | |
QString | className () const |
void | setClassName (const QString &) |
void | debug (QString) |
void | info (QString) |
void | warning (QString) |
void | error (QString) |
Static Public Member Functions | |
static void | setFileName (const QString &) |
static void | setLevel (Logger::LogLevel=DEBUG_LEVEL) |
static void | setLevel (const QString &) |
Private Member Functions | |
void | init () |
void | write (QString priority, QString text) |
Private Attributes | |
QString | m_className |
Static Private Attributes | |
static QPointer< QFile > | m_file |
static int | m_nbInstance = 0 |
static QString | m_logFileName |
static LogLevel | m_level = DEBUG_LEVEL |
Provides methods for multi-level logging into logfile and console.
SilentEyeFramework::Logger::Logger | ( | QObject * | parent = 0 | ) |
Definition at line 28 of file logger.cpp.
References m_className, and m_nbInstance.
SilentEyeFramework::Logger::Logger | ( | QString | className | ) |
Definition at line 37 of file logger.cpp.
References className(), m_className, and m_nbInstance.
SilentEyeFramework::Logger::~Logger | ( | ) |
Definition at line 54 of file logger.cpp.
References m_file, and m_nbInstance.
QString SilentEyeFramework::Logger::className | ( | ) | const |
void SilentEyeFramework::Logger::debug | ( | QString | text | ) |
Definition at line 80 of file logger.cpp.
References DEBUG_LEVEL, m_level, and write().
Referenced by SilentEye::ModuleManager::load(), SilentEye::ModuleManager::loadPlugin(), and main().
void SilentEyeFramework::Logger::error | ( | QString | text | ) |
Definition at line 98 of file logger.cpp.
References ERROR_LEVEL, m_level, and write().
void SilentEyeFramework::Logger::info | ( | QString | text | ) |
Definition at line 86 of file logger.cpp.
References INFO_LEVEL, m_level, and write().
Referenced by SilentEye::ModuleManager::loadPlugin().
void SilentEyeFramework::Logger::init | ( | ) | [private] |
Definition at line 43 of file logger.cpp.
References m_file, and SilentEyeFramework::m_fileName.
Referenced by write().
void SilentEyeFramework::Logger::setClassName | ( | const QString & | name | ) |
Definition at line 67 of file logger.cpp.
References m_className.
void SilentEyeFramework::Logger::setFileName | ( | const QString & | name | ) | [static] |
Definition at line 104 of file logger.cpp.
References SilentEyeFramework::m_fileName.
Referenced by main().
void SilentEyeFramework::Logger::setLevel | ( | const QString & | level | ) | [static] |
Definition at line 114 of file logger.cpp.
References DEBUG_LEVEL, ERROR_LEVEL, INFO_LEVEL, m_level, and WARNING_LEVEL.
void SilentEyeFramework::Logger::setLevel | ( | Logger::LogLevel | level = DEBUG_LEVEL | ) | [static] |
void SilentEyeFramework::Logger::warning | ( | QString | text | ) |
Definition at line 92 of file logger.cpp.
References m_level, WARNING_LEVEL, and write().
Referenced by SilentEye::ModuleManager::load(), SilentEye::ModuleManager::loadPlugin(), and showMessage().
void SilentEyeFramework::Logger::write | ( | QString | priority, |
QString | text | ||
) | [private] |
Definition at line 72 of file logger.cpp.
References init(), m_className, and m_file.
QString SilentEyeFramework::Logger::m_className [private] |
Definition at line 37 of file logger.h.
Referenced by className(), Logger(), setClassName(), and write().
QPointer< QFile > SilentEyeFramework::Logger::m_file [static, private] |
Logger::LogLevel SilentEyeFramework::Logger::m_level = DEBUG_LEVEL [static, private] |
QString SilentEyeFramework::Logger::m_logFileName [static, private] |
int SilentEyeFramework::Logger::m_nbInstance = 0 [static, private] |