forked from sus-ziti-uni-hd/epics-Logfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log_event.h
32 lines (25 loc) · 786 Bytes
/
log_event.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: MIT */
#pragma once
#include "logger.h"
#include <chrono>
#include <list>
#include <string>
namespace SuS {
namespace logfile {
struct log_event {
public:
logger::log_level level;
logger::subsystem_t subsystem;
std::string message;
std::chrono::system_clock::time_point time;
std::string function;
mutable std::string subsystem_string;
mutable std::string time_string;
}; // struct log_event
//! Format time as string in ISO format.
std::string format_time(const std::chrono::system_clock::time_point &_t);
//! Format time as string in seconds-since-epoch format.
std::string format_timestamp(const std::chrono::system_clock::time_point &_t);
using event_queue_t = std::list<log_event>;
} // namespace logfile
} // namespace SuS