45 std::map<std::string, std::clock_t>
_times;
54 inline void log_time_exec(
const char *p_fmt, ...);
67 static inline loggers& get_instance() {
return *_instance.get(); };
76 inline void log_to_hexa(
const char *p_prompt,
const TTCN_Buffer& buffer);
84 inline void log_to_hexa(
const char *p_prompt,
const OCTETSTRING& msg);
92 inline void log_to_hexa(
const char *p_prompt,
const unsigned char* msg,
const size_t msg_size);
100 inline void log_msg(
const char *p_prompt,
const Base_Type& p_type);
108 inline void log(
const char *p_fmt, ...);
117 inline void user_msg(
const char *p_prompt,
const Base_Type& p_type);
125 inline void user(
const char *p_fmt, ...);
134 inline void warning_msg(
const char *p_prompt,
const Base_Type& p_type);
142 inline void warning(
const char *p_fmt, ...);
151 inline void error(
const char *p_fmt, ...);
159 inline void set_start_time(std::string& p_time_key);
167 inline void set_stop_time(std::string& p_time_key,
float& p_time);
172 TTCN_Logger::begin_event(TTCN_Logger::DEBUG_UNQUALIFIED);
173 TTCN_Logger::log_event_str(p_prompt);
175 TTCN_Logger::end_event();
180 TTCN_Logger::begin_event(TTCN_Logger::DEBUG_UNQUALIFIED);
181 TTCN_Logger::log_event_str(p_prompt);
182 TTCN_Logger::log_event(
"Size: %d,\nMsg: ", msg.lengthof());
184 for(
int i = 0; i < msg.lengthof(); i++) {
185 TTCN_Logger::log_event(
" %02x", ((
const unsigned char*)msg)[i]);
187 TTCN_Logger::log_event(
"\n");
188 TTCN_Logger::end_event();
193 TTCN_Logger::begin_event(TTCN_Logger::DEBUG_UNQUALIFIED);
194 TTCN_Logger::log_event_str(p_prompt);
195 for(
size_t i = 0; i < msg_size; i++) {
196 TTCN_Logger::log_event(
" %02x", *(msg + i));
198 TTCN_Logger::log_event(
"\n");
199 TTCN_Logger::end_event();
204 TTCN_Logger::begin_event(TTCN_Logger::DEBUG_UNQUALIFIED);
205 TTCN_Logger::log_event_str(p_prompt);
207 TTCN_Logger::end_event();
212 TTCN_Logger::begin_event(TTCN_Logger::DEBUG_UNQUALIFIED);
214 va_start(args, p_fmt);
215 TTCN_Logger::log_event_va_list(p_fmt, args);
217 TTCN_Logger::end_event();
222 TTCN_Logger::begin_event(TTCN_Logger::USER_UNQUALIFIED);
223 TTCN_Logger::log_event_str(p_prompt);
225 TTCN_Logger::end_event();
230 TTCN_Logger::begin_event(TTCN_Logger::USER_UNQUALIFIED);
232 va_start(args, p_fmt);
233 TTCN_Logger::log_event_va_list(p_fmt, args);
235 TTCN_Logger::end_event();
240 TTCN_Logger::begin_event(TTCN_Logger::WARNING_UNQUALIFIED);
242 va_start(args, p_fmt);
243 TTCN_Logger::log_event_va_list(p_fmt, args);
245 TTCN_Logger::end_event();
250 TTCN_Logger::begin_event(TTCN_Logger::WARNING_UNQUALIFIED);
251 TTCN_Logger::log_event_str(p_prompt);
253 TTCN_Logger::end_event();
259 va_start(args, p_fmt);
260 TTCN_error(p_fmt, args);
266 _times[p_time_key] = std::clock();
271 std::map<std::string, std::clock_t>::iterator it = _times.find(p_time_key);
273 p_time = (std::clock() - _times[p_time_key]) * 1000.0 / CLOCKS_PER_SEC;
282 TTCN_Logger::begin_event(TTCN_Logger::EXECUTOR_RUNTIME);
284 va_start(args, p_fmt);
285 TTCN_Logger::log_event_va_list(p_fmt, args);
287 TTCN_Logger::end_event();
void warning(const char *p_fmt,...)
Definition: loggers.hh:238
void log(const char *p_fmt,...)
Debug message based on printf-compliant formatting message.
Definition: loggers.hh:210
void log_to_hexa(const char *p_prompt, const TTCN_Buffer &buffer)
Hexa dump of the.
Definition: loggers.hh:67
loggers()
Timer used to measure execution time between calls to methods ::set_start_time and ::set_stop_time...
Definition: loggers.hh:52
virtual ~loggers()
Default destructor.
Definition: loggers.hh:60
void user_msg(const char *p_prompt, const Base_Type &p_type)
User message of TITAN data structures.
Definition: loggers.hh:220
void log_msg(const char *p_prompt, const Base_Type &p_type)
Debug log of TITAN data structures.
Definition: loggers.hh:202
std::map< std::string, std::clock_t > _times
Smart pointer to the unique instance of the logger framework.
Definition: loggers.hh:45
static std::unique_ptr< loggers > _instance
Definition: loggers.hh:44
This class provides basic functionalities for an ITS dictionary.
Definition: loggers.hh:42
void user(const char *p_fmt,...)
User message based on printf-compliant formatting message.
Definition: loggers.hh:228
static loggers & get_instance()
Accessor for the unique instance of the logger framework .
Definition: loggers.hh:67
void error(const char *p_fmt,...)
Definition: loggers.hh:256
void set_stop_time(std::string &p_time_key, float &p_time)
Stop execution time measurement.
Definition: loggers.hh:269
void log_time_exec(const char *p_fmt,...)
Definition: loggers.hh:280
void set_start_time(std::string &p_time_key)
Start execution time measurement.
Definition: loggers.hh:264
void warning_msg(const char *p_prompt, const Base_Type &p_type)
Definition: loggers.hh:248