Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'GcodeProcessorLib/logger.h')
-rw-r--r--GcodeProcessorLib/logger.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/GcodeProcessorLib/logger.h b/GcodeProcessorLib/logger.h
index 9db2df1..8cbd5e3 100644
--- a/GcodeProcessorLib/logger.h
+++ b/GcodeProcessorLib/logger.h
@@ -36,7 +36,7 @@ enum log_levels { NOSET, VERBOSE, DEBUG, INFO, WARNING , ERROR, CRITICAL};
static const int log_level_names_size = 7;
static const char* log_level_names[] = {"NOSET", "VERBOSE", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"};
const static int log_level_values[LOG_LEVEL_COUNT] = { 0, 5, 10, 20, 30, 40, 50};
-
+#define DEFAULT_LOG_LEVEL_VALUE 40
class logger
{
public:
@@ -46,17 +46,18 @@ public:
void set_log_level_by_value(const int logger_type, const int log_level_value);
void set_log_level_by_value(const int log_level_value);
- void set_log_level(const int logger_type, const int log_level);
- void set_log_level(const int log_level);
-
- virtual void log(const int logger_type, const int log_level, const std::string& message);
- virtual void log(const int logger_type, const int log_level, const std::string& message, bool is_exception);
+ void set_log_level(const int logger_type, log_levels log_level);
+ void set_log_level(log_levels log_level);
+
+ std::string get_log_level_name(std::string logger_name);
+ virtual void log(const int logger_type, log_levels log_level, const std::string& message);
+ virtual void log(const int logger_type, log_levels log_level, const std::string& message, bool is_exception);
virtual void log_exception(const int logger_type, const std::string& message);
- static int get_log_level_value(const int log_level);
+ static int get_log_level_value(log_levels log_level);
static int get_log_level_for_value(int log_level_value);
- virtual bool is_log_level_enabled(const int logger_type, const int log_level);
+ virtual bool is_log_level_enabled(const int logger_type, log_levels log_level);
protected:
- virtual void create_log_message(const int logger_type, const int log_level, const std::string& message, std::string& output);
+ virtual void create_log_message(const int logger_type, log_levels log_level, const std::string& message, std::string& output);
bool loggers_created_;
private: