diff options
Diffstat (limited to 'gamemode/shared/log.lua')
| -rw-r--r-- | gamemode/shared/log.lua | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/gamemode/shared/log.lua b/gamemode/shared/log.lua index 92bb349..618fd0c 100644 --- a/gamemode/shared/log.lua +++ b/gamemode/shared/log.lua @@ -2,39 +2,28 @@ local fn = nrequire("fn.lua") local col = nrequire("colortheme.lua") local log = {} +local domain +if SERVER then + domain = "[SERVER]" +elseif CLIENT then + domain = "[CLIENT]" +end -log.debug = fn.compose( - fn.curry( - MsgC, - col.console.cyan - ), - fn.curry( - string.format, - "[DEBUG] %s\n" - ) -) +function log.debug(...) + MsgC(col.console.gray,domain,"[DEBUG]",...,"\n") +end -log.info = fn.compose( - fn.curry( - MsgC, - col.console.blue - ), - fn.curry( - string.format, - "[INFO] %s\n" - ) -) +function log.info(...) + MsgC(col.console.cyan,domain,"[INFO]",...,"\n") +end -log.warn = fn.compose( - fn.curry( - MsgC, - col.console.yellow - ), - fn.curry( - string.format, - "[WARNING] %s\n" - ) -) +function log.warn(...) + MsgC(col.console.yellow,domain,"[WARNING]",...,"\n") +end + +function log.error(...) + MsgC(col.console.red,domain,"[ERROR]",...,"\n") +end log.report = fn.curry( file.Append, |
