diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2017-11-04 22:42:24 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2017-11-04 22:42:24 -0400 |
| commit | 5d77d8475af7aff27eb026a4b56065387c024165 (patch) | |
| tree | ccdd061e5654288ab53134be52e8b1ef194d5ebc /gamemode/shared/log.lua | |
| parent | 40080dcfde028c64c4f6f51792b928ee91677bc6 (diff) | |
| download | artery-5d77d8475af7aff27eb026a4b56065387c024165.tar.gz artery-5d77d8475af7aff27eb026a4b56065387c024165.tar.bz2 artery-5d77d8475af7aff27eb026a4b56065387c024165.zip | |
Massive changes
* New error messages for missing dependencies
* Removed useless art_serverchanger entity
* Added a sweet ascii logo
* Added Skills
* Minor fixes to cl_inventory tracker
* Changed a few prints to use logging module
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, |
