1 /* 2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef LOGGER_H 6 #define LOGGER_H 7 8 #include <String.h> 9 #include <File.h> 10 #include <Path.h> 11 12 #include "PackageInfo.h" 13 14 15 typedef enum log_level { 16 LOG_LEVEL_OFF = 1, 17 LOG_LEVEL_INFO = 2, 18 LOG_LEVEL_DEBUG = 3, 19 LOG_LEVEL_TRACE = 4 20 } log_level; 21 22 23 class Logger { 24 public: 25 static log_level Level(); 26 static void SetLevel(log_level value); 27 static bool SetLevelByName(const char *name); 28 29 static bool IsInfoEnabled(); 30 static bool IsDebugEnabled(); 31 static bool IsTraceEnabled(); 32 33 private: 34 static log_level fLevel; 35 }; 36 37 38 #endif // LOGGER_H 39