-
Notifications
You must be signed in to change notification settings - Fork 0
Logger
mike edited this page Apr 26, 2020
·
7 revisions
All actions which occur in Sirius (create indexes, binding, etc) will be logged.
For example, on an application start (TodoMVC)
INFO: [APPLICATION] Logger is enabled? true
INFO: [APPLICATION] Adapter: JQueryAdapter-
enable_logging- enable or disable logs -
log_to- method for writing all messages in application -
minimum_log_level- by default isdebug
For enable logging use enable_logging option.
Sirius.Application.run({enable_logging: true})By default Sirius writes all logs with console.log method. You can redefine this:
// log levels: DEBUG, INFO, WARN, ERROR
my_logger = function(log_level, log_source, message) {
if (log_source == "MyController" && log_level == "ERROR")
ajax.send(message); // send on server all ERROR logs
}
Sirius.Application.run({
log_to: my_logger
})If you want to use logger into controller actions:
Controller =
logger: Sirius.Application.get_logger("Controller")
action: (params) ->
@logger.info("start action")