#include <string>
#include <stdexcept>
#include <iostream>
#include <fstream>
#include <sstream>
#include <mutex>
#include <unordered_map>
#include <memory>
#include <chrono>
#include <ctime>
#include <cstdlib>
#include <logging_common.hpp>
#include <logger.hpp>
#include <std_out_logger.hpp>
#include <file_logger.hpp>
#include <full_logger.hpp>
#include <logger_factory.hpp>
#include <logging_creation.hpp>
Go to the source code of this file.
|
std::string | logging::timestamp () |
| Obtain current timestamp with format: "yy/mm/dd HH:MM:SS.xxxxxx". More...
|
|
logger_factory & | logging::get_factory () |
| Obtain a logger factory singleton instance. More...
|
|
logger & | logging::get_logger (const logging_config_t &config={ {"type", "std_out"}, {"color", ""} }) |
| Obtain a singleton logger through singleton factory. More...
|
|
void | logging::configure (const logging_config_t &config) |
| Apply given configuration to current logger. More...
|
|
void | logging::log (const std::string &message, const log_level level) |
| Log function wrapper for singleton logger. More...
|
|
void | logging::log (const std::string &message) |
| Log function wrapper for singleton logger. More...
|
|
void | logging::makeQuiet () |
| Configure logging mode to make it quiet. Quiet mode means only errors will be shown.
|
|
void | logging::makeSilent () |
| Configure logging mode to make it silent. Silent mode means nothing will be shown.
|
|
void | logging::makeTime () |
| Configure logging mode to make it time. Time mode means only error and time messages will be shown.
|
|
void | logging::makeDefault () |
| Configure logging mode to make it default. Default mode means only info and error messages will be shown.
|
|
void | logging::makeVerbose () |
| Configure logging mode to make it verbose. Verbose mode means only info, warning and error messages will be shown.
|
|
void | logging::makeVerbose2 () |
| Configure logging mode to make it verbose level 2. Verbose level 2 mode means all messages will be shown.
|
|
void | logging::TRACE (const std::string &message) |
| Default trace messages logging function. More...
|
|
void | logging::DEBUG (const std::string &message) |
| Default debug messages logging function. More...
|
|
void | logging::INFO (const std::string &message) |
| Default info messages logging function. More...
|
|
void | logging::TIME (const std::string &message) |
| Default time messages loggin function. More...
|
|
void | logging::WARN (const std::string &message) |
| Default warning messages logging function. More...
|
|
void | logging::ERR (const std::string &message) |
| Default error messages logging function. More...
|
|
|
bool | logging::LOGGING_SHOW_TRACE |
|
bool | logging::LOGGING_SHOW_DEBUG |
|
bool | logging::LOGGING_SHOW_INFO |
|
bool | logging::LOGGING_SHOW_TIME |
|
bool | logging::LOGGING_SHOW_WARN |
|
bool | logging::LOGGING_SHOW_ERR |
|
◆ configure()
void logging::configure |
( |
const logging_config_t & |
config | ) |
|
|
inline |
Apply given configuration to current logger.
- Parameters
-
config | Configuration to be applied to singleton logger |
◆ DEBUG()
void logging::DEBUG |
( |
const std::string & |
message | ) |
|
|
inline |
Default debug messages logging function.
- Parameters
-
◆ ERR()
void logging::ERR |
( |
const std::string & |
message | ) |
|
|
inline |
Default error messages logging function.
- Parameters
-
◆ get_factory()
Obtain a logger factory singleton instance.
- Returns
- Logger factory singleton instance
◆ get_logger()
logger& logging::get_logger |
( |
const logging_config_t & |
config = { {"type", "std_out"}, {"color", ""} } | ) |
|
|
inline |
Obtain a singleton logger through singleton factory.
- Parameters
-
config | Config for the logger |
- Returns
- Singleton logger
◆ INFO()
void logging::INFO |
( |
const std::string & |
message | ) |
|
|
inline |
Default info messages logging function.
- Parameters
-
◆ log() [1/2]
void logging::log |
( |
const std::string & |
message | ) |
|
|
inline |
◆ log() [2/2]
void logging::log |
( |
const std::string & |
message, |
|
|
const log_level |
level |
|
) |
| |
|
inline |
◆ TIME()
void logging::TIME |
( |
const std::string & |
message | ) |
|
|
inline |
Default time messages loggin function.
- Parameters
-
◆ timestamp()
std::string logging::timestamp |
( |
| ) |
|
|
inline |
Obtain current timestamp with format: "yy/mm/dd HH:MM:SS.xxxxxx".
- Returns
- String timestamp with format: "yy/mm/dd HH:MM:SS.xxxxxx"
◆ TRACE()
void logging::TRACE |
( |
const std::string & |
message | ) |
|
|
inline |
Default trace messages logging function.
- Parameters
-
◆ WARN()
void logging::WARN |
( |
const std::string & |
message | ) |
|
|
inline |
Default warning messages logging function.
- Parameters
-