summaryrefslogtreecommitdiff
path: root/loghelper/init.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-22 14:08:20 +0800
committerchai <chaifix@163.com>2018-08-22 14:08:20 +0800
commit5cafb38a6fde6b786ba9b45b8faba02bc8f887cf (patch)
treeaeb453792cc0361bbe9504c7a54de0f770790214 /loghelper/init.lua
parentac0de268b46b136a6cdd6bbf096d93c1ff126329 (diff)
*update
Diffstat (limited to 'loghelper/init.lua')
-rw-r--r--loghelper/init.lua49
1 files changed, 0 insertions, 49 deletions
diff --git a/loghelper/init.lua b/loghelper/init.lua
deleted file mode 100644
index b227795..0000000
--- a/loghelper/init.lua
+++ /dev/null
@@ -1,49 +0,0 @@
--- 不能使用 debug 命名模块,会冲突,
--- 要使用其余名字比如 loghelper
-local log = {}
-io.stdout:setvbuf("no")
-
-log.LEVEL = {
- INFO = 4,
- DEBUG = 3,
- WARN = 2,
- ERROR = 1,
- NONE = 0
-}
-
-local logTag = {
- [log.LEVEL.INFO] = "[Info]",
- [log.LEVEL.DEBUG] = "[Debug]",
- [log.LEVEL.WARN] = "[Warn]",
- [log.LEVEL.ERROR] = "[Error]",
-}
-
-log.level = log.LEVEL.INFO
-
-log.strict = function(level)
- log.level = level
-end
-
-log.log = function(level, msg)
- if level <= log.level then
- print(logTag[level] .. ":" .. msg)
- end
-end
-
-log.info = function(msg)
- log.log(log.LEVEL.INFO, msg)
-end
-
-log.debug = function(msg)
- log.log(log.LEVEL.DEBUG, msg)
-end
-
-log.warn = function(msg)
- log.log(log.LEVEL.WARN, msg)
-end
-
-log.error = function(msg)
- log.log(log.LEVEL.ERROR, msg)
-end
-
-return log \ No newline at end of file