8 #ifndef DIAGNOSTIC_CLIENT_LIB_LIB_UTILITY_UTILITY_LOGGER_H 
    9 #define DIAGNOSTIC_CLIENT_LIB_LIB_UTILITY_UTILITY_LOGGER_H 
   11 #ifdef ENABLE_DLT_LOGGER 
   18 #include <string_view> 
   23 #define UNUSED_PARAM(expr) static_cast<void>(expr) 
   48   template<
typename Func>
 
   49   auto LogFatal(
const std::string_view file_name, 
int line_no, 
const std::string_view func_name,
 
   50                 Func &&func) noexcept -> 
void {
 
   51 #ifdef ENABLE_DLT_LOGGER 
   52     LogDltMessage(DLT_LOG_FATAL, file_name, func_name, line_no, std::forward<Func>(func));
 
   71   template<
typename Func>
 
   73                             const std::string_view func_name, Func &&func) noexcept -> 
void {
 
   74 #ifdef ENABLE_DLT_LOGGER 
   75     LogDltMessage(DLT_LOG_FATAL, file_name, func_name, line_no, std::forward<Func>(func));
 
   95   template<
typename Func>
 
   96   auto LogError(
const std::string_view file_name, 
int line_no, 
const std::string_view func_name,
 
   97                 Func &&func) noexcept -> 
void {
 
   98 #ifdef ENABLE_DLT_LOGGER 
   99     LogDltMessage(DLT_LOG_ERROR, file_name, func_name, line_no, std::forward<Func>(func));
 
  118   template<
typename Func>
 
  119   auto LogWarn(
const std::string_view file_name, 
int line_no, 
const std::string_view func_name,
 
  120                Func &&func) noexcept -> 
void {
 
  121 #ifdef ENABLE_DLT_LOGGER 
  122     LogDltMessage(DLT_LOG_WARN, file_name, func_name, line_no, std::forward<Func>(func));
 
  141   template<
typename Func>
 
  142   auto LogInfo(
const std::string_view file_name, 
int line_no, 
const std::string_view func_name,
 
  143                Func &&func) noexcept -> 
void {
 
  144 #ifdef ENABLE_DLT_LOGGER 
  145     LogDltMessage(DLT_LOG_INFO, file_name, func_name, line_no, std::forward<Func>(func));
 
  164   template<
typename Func>
 
  165   auto LogDebug(
const std::string_view file_name, 
int line_no, 
const std::string_view func_name,
 
  166                 Func &&func) noexcept -> 
void {
 
  167 #ifdef ENABLE_DLT_LOGGER 
  168     LogDltMessage(DLT_LOG_DEBUG, file_name, func_name, line_no, std::forward<Func>(func));
 
  187   template<
typename Func>
 
  188   auto LogVerbose(
const std::string_view file_name, 
int line_no, 
const std::string_view func_name,
 
  189                   Func &&func) noexcept -> 
void {
 
  190 #ifdef ENABLE_DLT_LOGGER 
  191     LogDltMessage(DLT_LOG_VERBOSE, file_name, func_name, line_no, std::forward<Func>(func));
 
  203   explicit Logger(std::string_view context_id);
 
  212   Logger(std::string_view app_id, std::string_view context_id);
 
  233   template<
typename Func>
 
  235                             const std::string_view , 
int line_no,
 
  236                             Func &&func) noexcept -> std::stringstream {
 
  237     std::stringstream msg{};
 
  239     msg << 
" [" << file_name << 
":" << line_no << 
"]";
 
  256 #ifdef ENABLE_DLT_LOGGER 
  257   template<
typename Func>
 
  258   void LogDltMessage(DltLogLevelType log_level, 
const std::string_view file_name,
 
  259                      const std::string_view func_name, 
int line_no, Func &&func) {
 
  281   template<
typename Func>
 
  283                              int line_no, Func &&func) {
 
  284     std::cout << CreateLoggingMessage(file_name, func_name, line_no, std::forward<Func>(func)).str()
 
  288 #ifdef ENABLE_DLT_LOGGER 
Logger class that is used to log Dlt messages from the component.
 
void LogMessageToStdOutput(const std::string_view file_name, const std::string_view func_name, int line_no, Func &&func)
Function to send the messages to dlt infrastructure.
 
auto LogDebug(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log debug message.
 
~Logger()
Destruct an instance of Logger.
 
Logger(std::string_view context_id)
Construct an instance of Logger.
 
bool registration_with_app_id_
 
auto LogVerbose(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log verbose message.
 
auto LogError(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log error message.
 
auto LogFatalAndTerminate(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log fatal message and abort.
 
auto LogInfo(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log info message.
 
auto LogFatal(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log fatal message.
 
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.
 
auto LogWarn(const std::string_view file_name, int line_no, const std::string_view func_name, Func &&func) noexcept -> void
Log warning message.