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 <string>
11
12#include "logging.h"
13
14namespace util::log {
16 LogSeverity severity);
17
26struct LogMessage {
27 std::chrono::time_point<std::chrono::system_clock> timestamp =
28 std::chrono::system_clock::now();
29 std::string message;
32};
33
34} // namespace util::log
Standard log interfaces.
The log namespace is used for log related classes and functions.
Definition idirectory.h:18
std::experimental::source_location Loc
Definition logging.h:41
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:26
util::log::Loc location
Source file and function.
Definition logmessage.h:31
std::chrono::time_point< std::chrono::system_clock > timestamp
Time of the message (UTC)
Definition logmessage.h:27
LogSeverity severity
Type of message.
Definition logmessage.h:30
std::string message
Message text.
Definition logmessage.h:29