1 |
|
|
#ifndef YAPLOG_LOGLOCATION_H_RANZIVOU |
2 |
|
|
#define YAPLOG_LOGLOCATION_H_RANZIVOU |
3 |
|
|
|
4 |
|
|
#include <cstddef> |
5 |
|
|
#include <string> |
6 |
|
|
|
7 |
|
|
namespace logger { |
8 |
|
|
|
9 |
|
|
/** |
10 |
|
|
* @brief Contains all information needed to localize a given point in |
11 |
|
|
* codebase. |
12 |
|
|
* |
13 |
|
|
* This structure especially retains current function name, current file |
14 |
|
|
* and current line. |
15 |
|
|
*/ |
16 |
|
|
struct log_location { |
17 |
|
|
/** |
18 |
|
|
* @brief Build a location structure with function file and line |
19 |
|
|
* information. |
20 |
|
|
* |
21 |
|
|
* @param function Function name. |
22 |
|
|
* @param file File name. |
23 |
|
|
* @param line Line number. |
24 |
|
|
*/ |
25 |
|
109 |
log_location(const char *function, |
26 |
|
|
const char *file, |
27 |
✓✗ |
109 |
const size_t line) : m_function(function) |
28 |
✓✗ |
109 |
, m_file(file) |
29 |
|
109 |
, m_line(line) |
30 |
|
109 |
{ } |
31 |
|
|
|
32 |
|
|
/** |
33 |
|
|
* @brief Function name. |
34 |
|
|
*/ |
35 |
|
|
const std::string m_function; |
36 |
|
|
/** |
37 |
|
|
* @brief File name. |
38 |
|
|
*/ |
39 |
|
|
const std::string m_file; |
40 |
|
|
/** |
41 |
|
|
* @brief Line number. |
42 |
|
|
*/ |
43 |
|
|
const size_t m_line; |
44 |
|
|
}; |
45 |
|
|
|
46 |
|
|
}; |
47 |
|
|
|
48 |
|
|
#endif /* end of include guard: YAPLOG_LOGLOCATION_H_RANZIVOU */ |