UTILLib 2.0
Common C++ library with utilities.
Loading...
Searching...
No Matches
logmessage.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
8#pragma once
9#include <chrono>
10#include <cstdint>
11#include <string>
12
13#include "util/logging.h"
14
15namespace util::log {
17 LogSeverity severity);
18
27struct LogMessage {
28 std::chrono::time_point<std::chrono::system_clock> timestamp =
29 std::chrono::system_clock::now();
30 std::string message;
32 uint32_t line = 0;
33 uint32_t column = 0;
34 std::string file;
35 std::string function;
36};
37
38} // namespace util::log
Standard log interfaces.
The log namespace is used for log related classes and functions.
Definition idirectory.h:18
LogSeverity
< Defines the log severity level
Definition logging.h:21
@ kInfo
Informational message.
Definition logging.h:24
std::string GetSeverityString(LogSeverity severity)
Returns the log level as a string.
Definition logmessage.h:27
std::chrono::time_point< std::chrono::system_clock > timestamp
Time of the message (UTC)
Definition logmessage.h:28
LogSeverity severity
Type of message.
Definition logmessage.h:31
std::string message
Message text.
Definition logmessage.h:30