-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathlogger.lua
More file actions
64 lines (54 loc) · 1.3 KB
/
Copy pathlogger.lua
File metadata and controls
64 lines (54 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- This Script is Part of the Prometheus Obfuscator by levno-710
--
-- logger.lua
--
-- This Script provides a Logger for Prometheus.
local logger = {}
local config = require("config");
local colors = require("colors");
logger.LogLevel = {
Error = 0,
Warn = 1,
Log = 2,
Info = 2,
Debug = 3,
}
logger.logLevel = logger.LogLevel.Log;
logger.debugCallback = function(...)
print(colors(config.NameUpper .. ": " .. ..., "grey"));
end;
function logger:debug(...)
if self.logLevel >= self.LogLevel.Debug then
self.debugCallback(...);
end
end
logger.logCallback = function(...)
print(colors(config.NameUpper .. ": ", "magenta") .. ...);
end;
function logger:log(...)
if self.logLevel >= self.LogLevel.Log then
self.logCallback(...);
end
end
function logger:info(...)
if self.logLevel >= self.LogLevel.Log then
self.logCallback(...);
end
end
logger.warnCallback = function(...)
print(colors(config.NameUpper .. ": " .. ..., "yellow"));
end;
function logger:warn(...)
if self.logLevel >= self.LogLevel.Warn then
self.warnCallback(...);
end
end
logger.errorCallback = function(...)
print(colors(config.NameUpper .. ": " .. ..., "red"))
error(...);
end;
function logger:error(...)
self.errorCallback(...);
error(config.NameUpper .. ": logger.errorCallback did not throw an Error!");
end
return logger;