Name: webapp-module-logger
Owner: Wire Swiss GmbH
Description: null
Created: 2016-07-12 08:04:37.0
Updated: 2017-10-19 12:27:07.0
Pushed: 2017-10-29 16:21:38.0
Homepage: null
Size: 58
Language: CoffeeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repository is part of the source code of Wire. You can find more information at wire.com or by contacting opensource@wire.com.
You can find the published source code at github.com/wireapp/wire.
For licensing information, see the attached LICENSE file and the list of third-party licenses at wire.com/legal/licenses/.
A powerful logger for Texts and objects (not for functions!).
install
t
eate release version
t dist
-> 0
L_1: -> 300 # FINEST (lowest value)
L_2: -> 400 # FINER
L_3: -> 500 # FINE
G: -> 700 # CONFIG
: -> 800 # INFO
: -> 900 # WARNING
R: -> 1000 # SEVERE
s Demo.DemoClass
nstructor: () ->
@logger = new z.util.Logger 'Test', options
@logger.level = @logger.levels.LEVEL_1
object =
first_line: "Hello"
second_line: "World"
ogger.log 'Log text.'
ogger.log 'Log text with object.', object
ogger.log 'Log text with priority.', @logger.levels.WARN
@logger.log 'Log text with priority and objects.', @logger.levels.WARN, object, object
@logger.log 'Log in whatever order you want.', object, @logger.levels.INFO, object, object
Use aliases for different log levels
ogger.info 'Log text as info.'
ogger.debug 'Log text as debug.'
ogger.error 'Log text as error.'
ogger.warn 'Log text as warning.'
Only log steps which have a minimum log level of info
ogger.level = @logger.levels.INFO
ogger.log 'This will not be shown.'
ogger.log 'This will...!', @logger.levels.INFO
ogger.log 'And this too!', @logger.levels.WARN
ogger.log @logger.levels.WARN', Even this!'
Don't show any log messages
ogger.level = @logger.levels.OFF
ger = new z.util.Logger 'z.auth.AuthRepository', name_length: 54
ger.set_domains
ocalhost': @logger.levels.LEVEL_1
ppspot.com': @logger.levels.LEVEL_1
ire.com': @logger.levels.INFO