CANpie FD
CAN programming interface environment - Version 3.08
|
This class add a logging capability for a QCanServer.
Public Slots | |
virtual void | appendMessage (const CAN_Channel_e teChannelV, const QString &clLogMessageV, LogLevel_e teLogLevelV=eLOG_LEVEL_INFO) |
Public Member Functions | |
QCanServerLogger (QCanServer *pclServerV=Q_NULLPTR) | |
void | attachServer (QCanServer *pclServerV) |
LogLevel_e | logLevel (const CAN_Channel_e teChannelV) |
QString | message (void) const |
bool | setFileName (const CAN_Channel_e teChannelV, QString clFileNameV) |
void | setLogLevel (const CAN_Channel_e teChannelV, LogLevel_e teLogLevelV) |
QCanServerLogger::QCanServerLogger | ( | QCanServer * | pclServerV = Q_NULLPTR | ) |
[in] | pclServerV | - Pointer to QCanServer class |
Create new QCanServerLogger object. The parameter pclServerV defines the QCanServer which shall be attached for logging.
|
virtualslot |
[in] | teChannelV | - CAN channel |
[in] | clLogMessageV | - Log message |
[in] | teLogLevelV | - Log level |
The function function appends a log message to the log file. The message will be prepended with a time-stamp. The parameter teLogLevelV
defines the log level of the message. Only messages with a log level smaller or equal to the actual defined log level will be appended (see setLogLevel()).
void QCanServerLogger::attachServer | ( | QCanServer * | pclServerV | ) |
[in] | pclServerV | - Pointer to QCanServer class |
The function attaches a QCanServer instance for logging.
LogLevel_e QCanServerLogger::logLevel | ( | const CAN_Channel_e | teChannelV | ) |
[in] | teChannelV | - CAN channel |
The function changes the default file path and file name for the log attached to the CAN channel defined by the parameter teChannelV.
|
inline |
The function returns the log message generated by appendMessage(), including the time-stamp.
bool QCanServerLogger::setFileName | ( | const CAN_Channel_e | teChannelV, |
QString | clFileNameV | ||
) |
[in] | teChannelV | - CAN channel |
[in] | clFileNameV | - Log file name |
true
if file could be opened, otherwise false
The function changes the default file path and file name for the log attached to the CAN channel defined by the parameter teChannelV.
void QCanServerLogger::setLogLevel | ( | const CAN_Channel_e | teChannelV, |
LogLevel_e | teLogLevelV | ||
) |
[in] | teChannelV | - CAN channel |
[in] | teLogLevelV | - Log level |
The function changes the default log level for the CAN channel defined by the parameter teChannelV. The new log level will be appended to the log file.