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 {
23 bool enabled = false;
24
28 Destination destination = Destination::kStandardOutput;
29
33 std::string log_file = "molybden.log";
34
39
46 LogLevel log_level = LogLevel::kInfo;
47
48 virtual ~Logging() = default;
49};
50
51} // namespace molybden
52
83#define LOG(severity) \
84 molybden::internal::LogMessage( \
85 __FILE__, \
86 __LINE__, \
87 static_cast<molybden::LogLevel>(molybden::internal::LEVEL_##severity))
88
89#endif // MOLYBDEN_LOGGING_HPP
Allows configuring the application logging.
Definition logging.hpp:19
Destination destination
The logging output destination.
Definition logging.hpp:28
std::string log_file
The absolute or relative path to the log file.
Definition logging.hpp:33
bool verbose_logging_enabled
Enables the verbose logging.
Definition logging.hpp:38
bool enabled
Indicates whether the logging is enabled.
Definition logging.hpp:23
LogLevel log_level
The log level of messages that must be written to the log file/standard output.
Definition logging.hpp:46