1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-10 15:48:36 -05:00
OC-PsychOS2/module/syslog.lua
XeonSquared aaccc053d3 cursed
2019-10-27 23:34:02 +11:00

18 lines
476 B
Lua

dprint=dprint or function() end
syslog = {}
syslog.emergency = 0
syslog.alert = 1
syslog.critical = 2
syslog.error = 3
syslog.warning = 4
syslog.notice = 5
syslog.info = 6
syslog.debug = 7
setmetatable(syslog,{__call = function(_,msg, level, service)
level, service = level or syslog.info, service or os.taskInfo(os.pid()).name or "unknown"
dprint(string.format("syslog: [%s:%d/%d] %s",service,os.pid(),level,msg))
computer.pushSignal("syslog",msg, level, service)
end})