fixed logging pattern
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// Logger.hpp
|
||||
#pragma once
|
||||
|
||||
#include <fstream>
|
||||
@@ -31,6 +30,9 @@ public:
|
||||
// String to LoggingLevels conversion
|
||||
static LoggingLevels stringToLogLevel(const std::string& level_str, LoggingLevels default_level = LoggingLevels::INFO);
|
||||
|
||||
// Convert LoggingLevels enum to string
|
||||
static std::string LogLevelToString(LoggingLevels level);
|
||||
|
||||
private:
|
||||
// the logging level to stay initialized to
|
||||
LoggingLevels log_level;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
// Log level enum that will be accessible to modules
|
||||
enum LoggingLevels {
|
||||
FATAL = 0,
|
||||
ERROR = 1,
|
||||
WARN = 2,
|
||||
INFO = 3,
|
||||
DEBUG = 4
|
||||
};
|
||||
extern "C" {
|
||||
// Log level enum that will be accessible to modules
|
||||
enum LoggingLevels {
|
||||
FATAL = 0,
|
||||
ERROR = 1,
|
||||
WARN = 2,
|
||||
INFO = 3,
|
||||
DEBUG = 4
|
||||
};
|
||||
}
|
||||
@@ -35,7 +35,8 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "ConfigManager.hpp"
|
||||
|
||||
#include "LoggingLevels.hpp"
|
||||
#include "Logger.hpp"
|
||||
|
||||
/*
|
||||
* Provides reserved symbol names we look for in modules.
|
||||
@@ -62,9 +63,9 @@ extern "C" {
|
||||
// Module description information
|
||||
const char* dpm_get_description(void);
|
||||
|
||||
// Callback function exposed by DPM core for modules to use
|
||||
int dpm_core_callback(const char* action, const char* data);
|
||||
|
||||
// Direct configuration access function
|
||||
const char* dpm_get_config(const char* section, const char* key);
|
||||
|
||||
// Direct logging function
|
||||
void dpm_log(int level, const char* message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user