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 "argument_utils.hpp"
8#include "../Enums.hpp"
9#include <thread>
10
11namespace logit {
12
15 struct LogRecord {
17 const int64_t timestamp_ms;
18 const std::string file;
19 const int line;
20 const std::string function;
21 const std::string format;
22 const std::string arg_names;
23 std::vector<VariableValue> args_array;
24 std::thread::id thread_id;
25 const int logger_index;
26 const bool print_mode;
27
39 const LogLevel& log_level,
40 const int64_t& timestamp_ms,
41 const std::string& file,
42 const int& line,
43 const std::string& function,
44 const std::string& format,
45 const std::string& arg_names,
46 const int& logger_index,
47 const bool& print_mode) :
50 file(file),
51 line(line),
55 thread_id(std::this_thread::get_id()),
58 };
59 };
60
61}; // namespace logit
62
63#endif // _LOGIT_LOG_RECORD_HPP_INCLUDED
Enumerations and utility functions for logging levels and text colors.
Functions for working with arguments and converting them to value arrays.
The primary namespace for the LogIt++ library.
LogLevel
Logging levels.
Definition Enums.hpp:14
Stores log metadata and content.
Definition LogRecord.hpp:15
const std::string function
Function name.
Definition LogRecord.hpp:20
const int logger_index
Logger index (-1 to log to all).
Definition LogRecord.hpp:25
const int line
Line number in the source file.
Definition LogRecord.hpp:19
std::thread::id thread_id
ID of the logging thread.
Definition LogRecord.hpp:24
const LogLevel log_level
Log level (severity).
Definition LogRecord.hpp:16
const int64_t timestamp_ms
Timestamp in milliseconds.
Definition LogRecord.hpp:17
const std::string file
Source file name.
Definition LogRecord.hpp:18
LogRecord(const LogLevel &log_level, const int64_t &timestamp_ms, const std::string &file, const int &line, const std::string &function, const std::string &format, const std::string &arg_names, const int &logger_index, const bool &print_mode)
Constructor with argument names.
Definition LogRecord.hpp:38
const std::string format
Format string for the message.
Definition LogRecord.hpp:21
std::vector< VariableValue > args_array
Argument values for the log.
Definition LogRecord.hpp:23
const std::string arg_names
Argument names for the log.
Definition LogRecord.hpp:22
const bool print_mode
Flag to determine whether arguments are printed in a raw format without special symbols.
Definition LogRecord.hpp:26