Molybden API
Loading...
Searching...
No Matches
logging.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_LOGGING_HPP
6#define MOLYBDEN_LOGGING_HPP
7
8#include "molybden/base/internal/log_message.hpp"
9
10#include <string>
11
12namespace molybden {
13
14enum class Destination { kStandardOutput, kFile };
15
19struct Logging {
20
24 bool enabled = false;
25
29 Destination destination = Destination::kStandardOutput;
30
34 std::string log_file = "molybden.log";
35
40
47 LogLevel log_level = LogLevel::kInfo;
48
49 virtual ~Logging() = default;
50};
51
52} // namespace molybden
53
84#define LOG(severity) molybden::internal::LogMessage(__FILE__, __LINE__, \
85 static_cast<molybden::LogLevel>(molybden::internal::LEVEL_##severity))
86
87#endif // MOLYBDEN_LOGGING_HPP
Allows configuring the application logging.
Definition logging.hpp:19
Destination destination
The logging output destination.
Definition logging.hpp:29
std::string log_file
The absolute or relative path to the log file.
Definition logging.hpp:34
bool verbose_logging_enabled
Enables the verbose logging.
Definition logging.hpp:39
bool enabled
Indicates whether the logging is enabled.
Definition logging.hpp:24
LogLevel log_level
The log level of messages that must be written to the log file/standard output.
Definition logging.hpp:47