aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/utils/je_log.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-12 21:48:33 +0800
committerchai <chaifix@163.com>2019-01-12 21:48:33 +0800
commit8b00d67febf133e89f6a0bfabc41feed555dc4a9 (patch)
treefe48ef17c250afa40c2588300fcdb5920dba6951 /src/libjin/utils/je_log.h
parenta907c39756ef6b368d06643afa491c49a9044a8e (diff)
*去掉文件前缀je_
Diffstat (limited to 'src/libjin/utils/je_log.h')
-rw-r--r--src/libjin/utils/je_log.h62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/libjin/utils/je_log.h b/src/libjin/utils/je_log.h
deleted file mode 100644
index 3d34943..0000000
--- a/src/libjin/utils/je_log.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef __LOG_H__ELPER_H__
-#define __LOG_H__ELPER_H__
-
-#include <string>
-#include <iostream>
-#include <fstream>
-#include <stdarg.h>
-
-#include "../core/je_configuration.h"
-
-class Loghelper
-{
-public:
- // logĿ
- enum Direction
- {
- DIR_CERR = 1 << 1, // ׼
- DIR_FILE = 1 << 2, // logļ
- };
-
- // ȼ
- enum Level
- {
- LV_NONE = 0, // none
- LV_ERROR = 1 << 1, // error
- LV_WARNING = 1 << 2, // warn
- LV_INFO = 1 << 3, // info
- LV_DEBUG = 1 << 4, // debug
- LV_ALL = 0xffffffff
- };
-
- static void log(Level _level, const char* _fmt, ...);
-
- // ض
- static void redirect(unsigned int _dir, char* _path = nullptr);
-
- // ɸѡȼ
- static void restrict(unsigned int levels);
-
- static void close();
-
-private:
- static unsigned int dir; // Ŀ
- static unsigned int levels; // ȼ
- static std::ofstream fs; // ļ
-};
-
-typedef Loghelper::Level Loglevel;
-
-#if defined(jin_debug)
- #define jin_log_error(f, ...) Loghelper::log(Loghelper::LV_ERROR, f, __VA_ARGS__)
- #define jin_log_info(f, ...) Loghelper::log(Loghelper::LV_INFO, f, __VA_ARGS__)
- #define jin_log_warning(f, ...) Loghelper::log(Loghelper::LV_WARNING, f, __VA_ARGS__)
- #define jin_log_debug(f, ...) Loghelper::log(Loghelper::LV_DEBUG, f, __VA_ARGS__)
-#else
- #define jin_log_error(f, ...)
- #define jin_log_info(f, ...)
- #define jin_log_warning(f, ...)
- #define jin_log_debug(f, ...)
-#endif
-
-#endif // __LOG_H__ELPER_H__ \ No newline at end of file