#include <FesaLogger.h>
Public Types | |
enum | DIAG_FWK_TOPIC { getActionProfiling = 1 << 0, setActionProfiling = 1 << 1, rtActionProfiling = 1 << 2, eventProfiling = 1 << 3, notificationProfiling = 1 << 4, getActionTracking = 1 << 5, setActionTracking = 1 << 6, rtActionTracking = 1 << 7, eventTracking = 1 << 8, notificationTracking = 1 << 9, persistencyTracking = 1 << 10, transactionTracking = 1 << 11, subscriptionTracking = 1 << 12, signalHandlerTracking = 1 << 13, rdaTracking = 1 << 15, startUpTracking = 1 << 31 } |
enum | LogType { errorType = 0, traceType = 1 } |
enum | LogSeverity { fatal = 0, alert = 1, critical = 2, error = 3, warning = 4, notice = 5, none = 6, debug = 7 } |
enum | LogAction { undefined = 0, start = 1, stop = 2 } |
Public Member Functions | |
FesaLogger & | logError (LogSeverity severity, const std::string &sender) |
bool | isEnabledFor (int32_t topic, const std::string &name, LogAction action) |
bool | isEnabledFor (DIAG_FWK_TOPIC topic) |
bool | isEnabledFor (int32_t topic, AbstractDevice *pdev, const std::string &name, LogAction action) |
FesaLogger (const FesaLogger &) | |
~FesaLogger () | |
void | send (const char *msg, LogType type) |
Static Public Member Functions | |
static bool | isEnabled () |
static void | init (char *bname) |
static void | enableConsoleOutput () |
static void | disableConsoleOutput () |
static void | reinit () |
static void | destroy () |
static FesaLogger * | getLogger (const std::string &source, const std::string &thread, const std::string &cname) |
static FesaLogger * | getLogger (const std::string &source, const std::string &thread) |
static FesaLogger * | getDefaultLogger () |
static void | setDiagnosticMode (bool mode) |
static void | setCustomTopic (int32_t customTopic, const std::string &cname) |
Public Attributes | |
int32_t | customTopic_ |
std::string | className_ |
std::string | logSource_ |
std::string | logThread_ |
std::string | logName_ |
Static Public Attributes | |
static const std::string | fwkSender = "FWK" |
static const std::string | usrSender = "USR" |
static int32_t | fwkTopic_ = 0xffffffff |
static bool | modeDiagnostic_ = false |
static uint32_t | logCount_ = 0 |
static TsCounter | logTsc_ |
static std::string | connectedHostName_ = "" |
static int32_t | connectedPortNumber_ = -1 |
Private Member Functions | |
FesaLogger (FesaLoggerBuffer *pBuf) | |
Private Attributes | |
LogSeverity | errSeverity_ |
LogType | logType_ |
int32_t | lastError_ |
FesaLoggerBuffer * | logBuffer_ |
Static Private Attributes | |
static UdpLogger * | pUDPLog_ = NULL |
static bool | isInitPhase_ = true |
static FesaLogger * | errLog_ |
static const char * | logActionStr_ [] = { "|-|", "|START|", "|STOP|" } |
static std::map< std::string, FesaLogger * > | logFactoryMap_ |
static FesaLogger * | defaultLog_ |
static Mutex | mutex_ |
Friends | |
class | FesaLoggerBuffer |
Definition at line 79 of file FesaLogger.h.
Definition at line 102 of file FesaLogger.h.
Definition at line 154 of file FesaLogger.h.
Definition at line 138 of file FesaLogger.h.
Definition at line 127 of file FesaLogger.h.
fesa::FesaLogger::FesaLogger | ( | const FesaLogger & | refLogger | ) |
Copy constructor
Definition at line 56 of file FesaLogger.cpp.
References className_, customTopic_, errSeverity_, FesaLoggerBuffer, lastError_, logBuffer_, logName_, logSource_, logThread_, logType_, modeDiagnostic_, and fesa::FesaLoggerBuffer::setFesaLogger().
Referenced by getLogger().
fesa::FesaLogger::~FesaLogger | ( | ) |
Destructor: clean associated ressources
Definition at line 80 of file FesaLogger.cpp.
References logBuffer_.
fesa::FesaLogger::FesaLogger | ( | FesaLoggerBuffer * | pBuf | ) | [private] |
Definition at line 41 of file FesaLogger.cpp.
References customTopic_, errSeverity_, isInitPhase_, lastError_, logBuffer_, modeDiagnostic_, none, and fesa::FesaLoggerBuffer::setFesaLogger().
void fesa::FesaLogger::destroy | ( | ) | [static] |
Definition at line 168 of file FesaLogger.cpp.
References logFactoryMap_, and pUDPLog_.
void fesa::FesaLogger::disableConsoleOutput | ( | ) | [static] |
Definition at line 127 of file FesaLogger.cpp.
References customTopic_, fwkTopic_, isInitPhase_, logFactoryMap_, and setDiagnosticMode().
void fesa::FesaLogger::enableConsoleOutput | ( | ) | [static] |
Definition at line 107 of file FesaLogger.cpp.
References customTopic_, fwkTopic_, isInitPhase_, logFactoryMap_, and setDiagnosticMode().
FesaLogger * fesa::FesaLogger::getDefaultLogger | ( | ) | [inline, static] |
------------------------------------------------------------------------- in line meyhods
Definition at line 322 of file FesaLogger.h.
References defaultLog_.
FesaLogger * fesa::FesaLogger::getLogger | ( | const std::string & | source, | |
const std::string & | thread | |||
) | [static] |
Definition at line 188 of file FesaLogger.cpp.
References getLogger(), and fesa::undefinedClassName.
FesaLogger * fesa::FesaLogger::getLogger | ( | const std::string & | source, | |
const std::string & | thread, | |||
const std::string & | cname | |||
) | [static] |
Definition at line 195 of file FesaLogger.cpp.
References className_, FesaLogger(), FesaLoggerBuffer, logFactoryMap_, logName_, logSource_, logThread_, logType_, mutex_, traceType, fesa::undefinedClassName, and fesa::undefinedThreadName.
Referenced by getLogger().
void fesa::FesaLogger::init | ( | char * | bname | ) | [static] |
Definition at line 90 of file FesaLogger.cpp.
bool fesa::FesaLogger::isEnabled | ( | ) | [static] |
Definition at line 100 of file FesaLogger.cpp.
References modeDiagnostic_.
bool fesa::FesaLogger::isEnabledFor | ( | int32_t | topic, | |
AbstractDevice * | pdev, | |||
const std::string & | name = undefinedFunctionName , |
|||
LogAction | action = undefined | |||
) | [inline] |
Definition at line 366 of file FesaLogger.h.
References customTopic_, fesa::AbstractDevice::isLoggable_, logActionStr_, modeDiagnostic_, and SET_TRACE_HEADER.
bool fesa::FesaLogger::isEnabledFor | ( | DIAG_FWK_TOPIC | topic | ) | [inline] |
Definition at line 354 of file FesaLogger.h.
References fwkTopic_, modeDiagnostic_, and SET_TRACE_HEADER.
bool fesa::FesaLogger::isEnabledFor | ( | int32_t | topic, | |
const std::string & | name = undefinedFunctionName , |
|||
LogAction | action = undefined | |||
) | [inline] |
Definition at line 340 of file FesaLogger.h.
References customTopic_, logActionStr_, modeDiagnostic_, and SET_TRACE_HEADER.
FesaLogger & fesa::FesaLogger::logError | ( | LogSeverity | severity, | |
const std::string & | sender = FesaLogger::usrSender | |||
) | [inline] |
Definition at line 332 of file FesaLogger.h.
References errorType, errSeverity_, and logType_.
void fesa::FesaLogger::reinit | ( | ) | [static] |
Definition at line 144 of file FesaLogger.cpp.
References connectedHostName_, connectedPortNumber_, logCount_, and pUDPLog_.
Referenced by fesa::RTDiagnosticSetting::execute().
void fesa::FesaLogger::send | ( | const char * | msg, | |
LogType | type | |||
) |
Definition at line 295 of file FesaLogger.cpp.
References error, errSeverity_, isInitPhase_, lastError_, logType_, modeDiagnostic_, pUDPLog_, fesa::UdpLogger::sendStr(), and traceType.
void fesa::FesaLogger::setCustomTopic | ( | int32_t | customTopic, | |
const std::string & | cname | |||
) | [static] |
Definition at line 277 of file FesaLogger.cpp.
References className_, customTopic_, and logFactoryMap_.
Referenced by fesa::RTDiagnosticSetting::execute().
void fesa::FesaLogger::setDiagnosticMode | ( | bool | mode | ) | [static] |
Definition at line 252 of file FesaLogger.cpp.
References connectedHostName_, connectedPortNumber_, lastError_, logFactoryMap_, modeDiagnostic_, and pUDPLog_.
Referenced by disableConsoleOutput(), enableConsoleOutput(), and fesa::RTDiagnosticSetting::execute().
friend class FesaLoggerBuffer [friend] |
Definition at line 244 of file FesaLogger.h.
Referenced by FesaLogger(), and getLogger().
std::string fesa::FesaLogger::className_ |
Definition at line 236 of file FesaLogger.h.
Referenced by FesaLogger(), getLogger(), and setCustomTopic().
std::string fesa::FesaLogger::connectedHostName_ = "" [static] |
Definition at line 233 of file FesaLogger.h.
Referenced by fesa::RTDiagnosticSetting::execute(), reinit(), and setDiagnosticMode().
int32_t fesa::FesaLogger::connectedPortNumber_ = -1 [static] |
Definition at line 234 of file FesaLogger.h.
Referenced by fesa::RTDiagnosticSetting::execute(), reinit(), and setDiagnosticMode().
int32_t fesa::FesaLogger::customTopic_ |
Definition at line 216 of file FesaLogger.h.
Referenced by disableConsoleOutput(), enableConsoleOutput(), FesaLogger(), isEnabledFor(), and setCustomTopic().
FesaLogger * fesa::FesaLogger::defaultLog_ [static, private] |
Definition at line 280 of file FesaLogger.h.
Referenced by getDefaultLogger().
FesaLogger* fesa::FesaLogger::errLog_ [static, private] |
Definition at line 269 of file FesaLogger.h.
LogSeverity fesa::FesaLogger::errSeverity_ [private] |
Definition at line 257 of file FesaLogger.h.
Referenced by FesaLogger(), logError(), send(), and fesa::FesaLoggerBuffer::sync().
const std::string fesa::FesaLogger::fwkSender = "FWK" [static] |
Definition at line 87 of file FesaLogger.h.
int32_t fesa::FesaLogger::fwkTopic_ = 0xffffffff [static] |
Definition at line 215 of file FesaLogger.h.
Referenced by disableConsoleOutput(), enableConsoleOutput(), fesa::RTDiagnosticSetting::execute(), and isEnabledFor().
bool fesa::FesaLogger::isInitPhase_ = true [static, private] |
Definition at line 267 of file FesaLogger.h.
Referenced by disableConsoleOutput(), enableConsoleOutput(), FesaLogger(), send(), and fesa::FesaLoggerBuffer::sync().
int32_t fesa::FesaLogger::lastError_ [private] |
Definition at line 264 of file FesaLogger.h.
Referenced by FesaLogger(), send(), setDiagnosticMode(), and fesa::FesaLoggerBuffer::sync().
const char * fesa::FesaLogger::logActionStr_ = { "|-|", "|START|", "|STOP|" } [static, private] |
Definition at line 274 of file FesaLogger.h.
Referenced by isEnabledFor().
FesaLoggerBuffer* fesa::FesaLogger::logBuffer_ [private] |
Definition at line 286 of file FesaLogger.h.
Referenced by FesaLogger(), and ~FesaLogger().
uint32_t fesa::FesaLogger::logCount_ = 0 [static] |
Definition at line 222 of file FesaLogger.h.
Referenced by reinit().
std::map< std::string, FesaLogger * > fesa::FesaLogger::logFactoryMap_ [static, private] |
Definition at line 277 of file FesaLogger.h.
Referenced by destroy(), disableConsoleOutput(), enableConsoleOutput(), getLogger(), setCustomTopic(), and setDiagnosticMode().
std::string fesa::FesaLogger::logName_ |
Definition at line 239 of file FesaLogger.h.
Referenced by FesaLogger(), and getLogger().
std::string fesa::FesaLogger::logSource_ |
Definition at line 237 of file FesaLogger.h.
Referenced by FesaLogger(), and getLogger().
std::string fesa::FesaLogger::logThread_ |
Definition at line 238 of file FesaLogger.h.
Referenced by FesaLogger(), and getLogger().
TsCounter fesa::FesaLogger::logTsc_ [static] |
Definition at line 225 of file FesaLogger.h.
Referenced by fesa::RTDiagnosticSetting::RTDiagnosticSetting().
LogType fesa::FesaLogger::logType_ [private] |
Definition at line 260 of file FesaLogger.h.
Referenced by FesaLogger(), getLogger(), logError(), send(), and fesa::FesaLoggerBuffer::sync().
bool fesa::FesaLogger::modeDiagnostic_ = false [static] |
Definition at line 219 of file FesaLogger.h.
Referenced by fesa::RTDiagnosticSetting::execute(), FesaLogger(), isEnabled(), isEnabledFor(), send(), setDiagnosticMode(), and fesa::FesaLoggerBuffer::sync().
Mutex fesa::FesaLogger::mutex_ [static, private] |
Definition at line 283 of file FesaLogger.h.
Referenced by getLogger().
UdpLogger * fesa::FesaLogger::pUDPLog_ = NULL [static, private] |
Definition at line 251 of file FesaLogger.h.
Referenced by destroy(), reinit(), send(), setDiagnosticMode(), and fesa::FesaLoggerBuffer::sync().
const std::string fesa::FesaLogger::usrSender = "USR" [static] |
Definition at line 88 of file FesaLogger.h.