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
6
7#include <thread>
8
9namespace logit {
10
13 struct LogRecord {
15 const int64_t timestamp_ms;
16 const std::string file;
17 const int line;
18 const std::string function;
19 const std::string format;
20 const std::string arg_names;
21 std::vector<VariableValue> args_array;
22 std::thread::id thread_id;
23 const int logger_index;
24 const bool print_mode;
25
38 int64_t timestamp_ms,
39 const std::string& file,
40 int line,
41 const std::string& function,
42 const std::string& format,
43 const std::string& arg_names,
44 int logger_index,
45 bool print_mode) :
48 file(file),
49 line(line),
53 thread_id(std::this_thread::get_id()),
56 };
57 };
58
59}; // namespace logit
60
61#endif // _LOGIT_LOG_RECORD_HPP_INCLUDED
The primary namespace for the LogIt++ library.
LogLevel
Logging levels.
Definition Enums.hpp:14
const std::string function
Function name.
Definition LogRecord.hpp:18
const int logger_index
Logger index (-1 to log to all).
Definition LogRecord.hpp:23
const int line
Line number in the source file.
Definition LogRecord.hpp:17
std::thread::id thread_id
ID of the logging thread.
Definition LogRecord.hpp:22
const LogLevel log_level
Log level (severity).
Definition LogRecord.hpp:14
const int64_t timestamp_ms
Timestamp in milliseconds.
Definition LogRecord.hpp:15
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:36
const std::string file
Source file name.
Definition LogRecord.hpp:16
const std::string format
Format string for the message.
Definition LogRecord.hpp:19
std::vector< VariableValue > args_array
Argument values for the log.
Definition LogRecord.hpp:21
const std::string arg_names
Argument names for the log.
Definition LogRecord.hpp:20
const bool print_mode
Flag to determine whether arguments are printed in a raw format without special symbols.
Definition LogRecord.hpp:24