--- Logging utility. -- This prints things to the console for now, maybe it can automatically file bugs and save bug reports in the future? --@module log.lua local log = {} local fn = nrequire("fn.lua") local col = nrequire("colortheme.lua") local domain if SERVER then domain = "[SERVER]" elseif CLIENT then domain = "[CLIENT]" end --- Print a debug message. -- This can be suppressed in release versions function log.debug(...) MsgC(col.console.gray,domain,"[DEBUG]",table.concat({...}," "),"\n") end --- Print an information message. -- Things server owners might want to see function log.info(...) MsgC(col.console.cyan,domain,"[INFO]",table.concat({...}," "),"\n") end --- Prints a warning. -- Things developers need to look at -- Maybe print this to a file in the future? function log.warn(...) MsgC(col.console.yellow,domain,"[WARNING]",table.concat({...}," "),"\n") end --- Prints an error. -- Things that should never happen -- Maybe have this automatically make bugs on the bug tracker with the above log files? function log.error(...) MsgC(col.console.red,domain,"[ERROR]",table.concat({...}," "),"\n") end log.report = fn.curry( file.Append, "artery/report_log.txt" ) return log