@leansdk/leanrc
Version:
LeanRC is a MVC framework for creating graceful applications
45 lines (36 loc) • 958 B
text/coffeescript
module.exports = (Module) ->
{
NILL
SimpleCommand
LogMessageCommand
Application
LogMessage: { CHANGE, NONE, FATAL, ERROR, WARN, INFO, DEBUG }
} = Module::
{
LOGGER_PROXY
} = Application::
class LoggerProxy extends Module::Proxy
Module
addLogEntry: Function,
args: [Object]
return: NILL
default: (data)->
{logLevel, sender, time, message} = data
switch logLevel
when FATAL, ERROR
console.error sender, '->', message
when INFO
console.info sender, '->', message
when DEBUG
console.log sender, '->', message
when WARN
console.warn sender, '->', message
else
console.log sender, '->', message
return
init: Function,
default: ->
LOGGER_PROXY, []
return
LoggerProxy.initialize()