|
CAN programming interface environment
Version 3.10
|
This class add a logging capability for a QCanServer.
#include <qcan_server_logger.hpp>
Inheritance diagram for QCanServerLogger:Public Slots | |
| virtual void | appendMessage (const QCan::CAN_Channel_e teChannelV, const QString &clLogMessageV, const QCan::LogLevel_e teLogLevelV=QCan::eLOG_LEVEL_INFO) |
Public Member Functions | |
| QCanServerLogger (QCanServer *pclServerV=nullptr) | |
| void | attachServer (QCanServer *pclServerV) |
| QCan::LogLevel_e | logLevel (const QCan::CAN_Channel_e teChannelV) const |
| QString | message (void) const |
| bool | setFileName (const QCan::CAN_Channel_e teChannelV, const QString clFileNameV) |
| void | setLogLevel (const QCan::CAN_Channel_e teChannelV, const QCan::LogLevel_e teLogLevelV) |
| QCanServerLogger::QCanServerLogger | ( | QCanServer * | pclServerV = 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 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.
| QCan::LogLevel_e QCanServerLogger::logLevel | ( | const QCan::CAN_Channel_e | teChannelV | ) | const |
| [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 QCan::CAN_Channel_e | teChannelV, |
| const 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 QCan::CAN_Channel_e | teChannelV, |
| const QCan::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.