retdec
log.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_UTILS_IO_LOG_H
8 #define RETDEC_UTILS_IO_LOG_H
9 
10 #include "retdec/utils/io/logger.h"
11 
12 namespace retdec {
13 namespace utils {
14 namespace io {
15 
16 class Log {
17 public:
22  enum class Type : int {
23  Info = 0,
24  Debug,
25  Error,
26  Undefined
27  };
28 
31 
32 public:
46  static Logger& get(const Type& logType);
47 
51  static void set(const Type& logType, Logger::Ptr&& logger);
52 
60  static Logger info();
61 
69  static Logger debug();
70 
78  static Logger error();
79 
83  static void phase(
84  const std::string& phaseId,
85  const Log::Action& action = Log::Action::Phase);
86 
87 public:
92  static const Action Error;
93 
98  static const Action Warning;
99 
104  static const Action Phase;
105 
110  static const Action SubPhase;
111 
116  static const Action SubSubPhase;
117 
122  static const Action ElapsedTime;
123 
124 private:
128  static Logger::Ptr writers[static_cast<int>(Type::Undefined)+1];
129 
135 };
136 
137 }
138 }
139 }
140 
141 
142 #endif
Definition: log.h:16
static const Action SubPhase
Definition: log.h:110
static Logger info()
Definition: log.cpp:54
static const Action Phase
Definition: log.h:104
static const Action SubSubPhase
Definition: log.h:116
static Logger::Ptr writers[static_cast< int >(Type::Undefined)+1]
Definition: log.h:128
static void set(const Type &logType, Logger::Ptr &&logger)
Definition: log.cpp:45
static const Action Error
Definition: log.h:92
static Logger debug()
Definition: log.cpp:64
static void phase(const std::string &phaseId, const Log::Action &action=Log::Action::Phase)
Definition: log.cpp:59
Type
Definition: log.h:22
static Logger error()
Definition: log.cpp:69
static Logger & get(const Type &logType)
Definition: log.cpp:32
static const Action ElapsedTime
Definition: log.h:122
static Logger defaultLogger
Definition: log.h:134
static const Action Warning
Definition: log.h:98
Provides Logger inteface that is used for logging events during decompilation.
Definition: logger.h:22
Color
Definition: logger.h:37
std::unique_ptr< Logger > Ptr
Definition: logger.h:24
Action
Definition: logger.h:27
Provides unified logging interface.
Definition: archive_wrapper.h:19