Diag-Client-Lib
logger.h
Go to the documentation of this file.
1 /* Diagnostic Client library
2  * Copyright (C) 2024 Avijit Dey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 #ifndef DIAGNOSTIC_CLIENT_LIB_LIB_DOIP_CLIENT_COMMON_LOGGER_H
9 #define DIAGNOSTIC_CLIENT_LIB_LIB_DOIP_CLIENT_COMMON_LOGGER_H
10 
11 #include "utility/logger.h"
12 
13 namespace doip_client {
14 namespace logger {
15 
17 
19  public:
20  auto static GetDiagClientLogger() noexcept -> DoipClientLogger& {
21  static DoipClientLogger diag_client_logger_;
22  return diag_client_logger_;
23  }
24 
25  auto GetLogger() noexcept -> Logger& { return logger_; }
26 
27  private:
28  DoipClientLogger() = default;
29 
30  // actual logger context
31  Logger logger_{"doip"};
32 };
33 
34 } // namespace logger
35 } // namespace doip_client
36 
37 #endif // DIAGNOSTIC_CLIENT_LIB_LIB_DOIP_CLIENT_COMMON_LOGGER_H
auto GetLogger() noexcept -> Logger &
Definition: logger.h:25
static auto GetDiagClientLogger() noexcept -> DoipClientLogger &
Definition: logger.h:20
Logger class that is used to log Dlt messages from the component.
Definition: logger.h:32
utility::logger::Logger Logger
Definition: logger.h:16