mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 09:40:04 +08:00
23 lines
654 B
Plaintext
23 lines
654 B
Plaintext
|
Execute ( SpaceVim api: logger ):
|
||
|
new
|
||
|
let log = SpaceVim#api#import('logger')
|
||
|
call log.set_name('TestLog')
|
||
|
AssertEqual log.name, 'TestLog'
|
||
|
call log.info('info test')
|
||
|
call log.warn('info test')
|
||
|
call log.error('info test')
|
||
|
AssertEqual len(log.temp), 3
|
||
|
call log.set_level(2)
|
||
|
call log.info('info test')
|
||
|
call log.warn('info test')
|
||
|
call log.error('info test')
|
||
|
AssertEqual len(log.temp), 5
|
||
|
call log.set_level(3)
|
||
|
call log.info('info test')
|
||
|
call log.warn('info test')
|
||
|
call log.error('info test')
|
||
|
AssertEqual len(log.temp), 6
|
||
|
AssertEqual len(log.view(1)), 6
|
||
|
AssertEqual len(log.view(2)), 5
|
||
|
AssertEqual len(log.view(3)), 3
|