LogIt++
Loading...
Searching...
No Matches
LogRecord.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef _LOGIT_LOG_RECORD_HPP_INCLUDED
3#define _LOGIT_LOG_RECORD_HPP_INCLUDED
4
7
8#include <thread>
9
10namespace logit {
11
14 struct LogRecord {
16 const int64_t timestamp_ms;
17 const std::string file;
18 const int line;
19 const std::string function;
20 const std::string format;
21 const std::string arg_names;
22 std::vector<VariableValue> args_array;
23 std::thread::id thread_id;
24 const int logger_index;
25 const bool print_mode;
26
39 int64_t timestamp_ms,
40 const std::string& file,
41 int line,
42 const std::string& function,
43 const std::string& format,
44 const std::string& arg_names,
45 int logger_index,
46 bool print_mode) :
49 file(file),
50 line(line),
54 thread_id(std::this_thread::get_id()),
57 };
58 };
59
60}; // namespace logit
61
62#endif // _LOGIT_LOG_RECORD_HPP_INCLUDED
The primary namespace for the LogIt++ library.
LogLevel
Logging levels.
Definition enums.hpp:15
const std::string function
Function name.
Definition LogRecord.hpp:19
const int logger_index
Logger index (-1 to log to all).
Definition LogRecord.hpp:24
const int line
Line number in the source file.
Definition LogRecord.hpp:18
std::thread::id thread_id
ID of the logging thread.
Definition LogRecord.hpp:23
const LogLevel log_level
Log level (severity).
Definition LogRecord.hpp:15
const int64_t timestamp_ms
Timestamp in milliseconds.
Definition LogRecord.hpp:16
LogRecord(LogLevel log_level, int64_t timestamp_ms, const std::string &file, int line, const std::string &function, const std::string &format, const std::string &arg_names, int logger_index, bool print_mode)
Constructor with argument names.
Definition LogRecord.hpp:37
const std::string file
Source file name.
Definition LogRecord.hpp:17
const std::string format
Format string for the message.
Definition LogRecord.hpp:20
std::vector< VariableValue > args_array
Argument values for the log.
Definition LogRecord.hpp:22
const std::string arg_names
Argument names for the log.
Definition LogRecord.hpp:21
const bool print_mode
Flag to determine whether arguments are printed in a raw format without special symbols.
Definition LogRecord.hpp:25