Diag-Client-Lib
|
Logger class that is used to log Dlt messages from the component. More...
#include <logger.h>
Public Member Functions | |
template<typename Func > | |
auto | LogFatal (const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void |
Log fatal message and abort. More... | |
template<typename Func > | |
auto | LogError (const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void |
Log error message. More... | |
template<typename Func > | |
auto | LogWarn (const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void |
Log warning message. More... | |
template<typename Func > | |
auto | LogInfo (const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void |
Log info message. More... | |
template<typename Func > | |
auto | LogDebug (const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void |
Log debug message. More... | |
template<typename Func > | |
auto | LogVerbose (const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void |
Log verbose message. More... | |
Logger (std::string_view context_id) | |
Construct an instance of Logger. More... | |
Logger (std::string_view app_id, std::string_view context_id) | |
Construct an instance of Logger. More... | |
~Logger () | |
Destruct an instance of Logger. More... | |
Private Member Functions | |
template<typename Func > | |
auto | CreateLoggingMessage (const std::string_view file_name, const std::string_view, int line_no, Func &&func) noexcept -> std::stringstream |
Function to create the final logging message. More... | |
Private Attributes | |
std::string | contxt_ |
Function to send the messages to dlt infrastructure. More... | |
std::string | app_id_ |
std::string | context_id_ |
bool | registration_with_app_id_ {} |
Logger class that is used to log Dlt messages from the component.
This class uses COVESA DLT infrastructure to send message to DLT. Also the class does not log dlt message if "ENABLE_DLT_LOGGER" cmake flag is set to OFF
|
explicit |
Construct an instance of Logger.
[in] | context_id | The context id of the user |
Definition at line 14 of file logger.cpp.
References context_id_, contxt_, registration_with_app_id_, and UNUSED_PARAM.
utility::logger::Logger::Logger | ( | std::string_view | app_id, |
std::string_view | context_id | ||
) |
Construct an instance of Logger.
[in] | app_id | The application id of the user |
[in] | context_id | The context id of the user |
Definition at line 26 of file logger.cpp.
References app_id_, context_id_, contxt_, registration_with_app_id_, and UNUSED_PARAM.
utility::logger::Logger::~Logger | ( | ) |
Destruct an instance of Logger.
Definition at line 39 of file logger.cpp.
References contxt_, and registration_with_app_id_.
|
inlineprivatenoexcept |
Function to create the final logging message.
Func | The functor type |
[in] | file_name | The file name |
[in] | func_name | The function name |
[in] | line_no | The line number |
[in] | func | The functor which gets invoked |
|
inlinenoexcept |
Log debug message.
Func | The functor type invoked on log level set to debug |
[in] | file_name | The file name |
[in] | line_no | The line number |
[in] | func_name | The function name |
[in] | func | The functor which gets invoked on log level set to debug |
Definition at line 153 of file logger.h.
References UNUSED_PARAM.
|
inlinenoexcept |
Log error message.
Func | The functor type invoked on log level set to error |
[in] | file_name | The file name |
[in] | line_no | The line number |
[in] | func_name | The function name |
[in] | func | The functor which gets invoked on log level set to error |
Definition at line 75 of file logger.h.
References UNUSED_PARAM.
|
inlinenoexcept |
Log fatal message and abort.
Func | The functor type invoked on log level set to fatal |
[in] | file_name | The file name |
[in] | line_no | The line number |
[in] | func_name | The function name |
[in] | func | The functor which gets invoked on log level set to fatal |
Definition at line 48 of file logger.h.
References UNUSED_PARAM.
|
inlinenoexcept |
Log info message.
Func | The functor type invoked on log level set to info |
[in] | file_name | The file name |
[in] | line_no | The line number |
[in] | func_name | The function name |
[in] | func | The functor which gets invoked on log level set to info |
Definition at line 127 of file logger.h.
References UNUSED_PARAM.
|
inlinenoexcept |
Log verbose message.
Func | The functor type invoked on log level set to verbose |
[in] | file_name | The file name |
[in] | line_no | The line number |
[in] | func_name | The function name |
[in] | func | The functor which gets invoked on log level set to verbose |
Definition at line 179 of file logger.h.
References UNUSED_PARAM.
|
inlinenoexcept |
Log warning message.
Func | The functor type invoked on log level set to warning |
[in] | file_name | The file name |
[in] | line_no | The line number |
[in] | func_name | The function name |
[in] | func | The functor which gets invoked on log level set to warning |
Definition at line 101 of file logger.h.
References UNUSED_PARAM.
|
private |
|
private |
|
private |
|
private |