1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var cs = require('console');
var dog = {}
dog.name = "大毛"
dog.color= "绿色"
print("输出普通信息:")
cs.log('result:%s', 'test%s')
cs.log('result:%d', 144)
cs.log('result:%i', 244)
cs.log('result:%f', 123.412)
cs.log('result:%o', dog)
cs.log('result:%j', {name:"haha", age:16})
cs.log('%c', 'color:blue;')
print("输出提示信息:")
cs.info('result:%s', 'test%s')
cs.info('result:%d', 144)
cs.info('result:%i', 244)
cs.info('result:%f', 123.412)
cs.info('result:%o', dog)
cs.info('result:%j', {name:"haha", age:16})
cs.info('%c', 'color:blue;')
print("输出调试信息:")
cs.debug('result:%s', 'test%s')
cs.debug('result:%d', 144)
cs.debug('result:%i', 244)
cs.debug('result:%f', 123.412)
cs.debug('result:%o', dog)
cs.debug('result:%j', {name:"haha", age:16})
cs.debug('%c', 'color:blue;')
print("输出警告信息:")
cs.warn('result:%s', 'test%s')
cs.warn('result:%d', 144)
cs.warn('result:%i', 244)
cs.warn('result:%f', 123.412)
cs.warn('result:%o', dog)
cs.warn('result:%j', {name:"haha", age:16})
cs.warn('%c', 'color:blue;')
print("输出错误信息:")
cs.error('result:%s', 'test%s')
cs.error('result:%d', 144)
cs.error('result:%i', 244)
cs.error('result:%f', 123.412)
cs.error('result:%o', dog)
cs.error('result:%j', {name:"haha", age:16})
cs.error('%c', 'color:blue;')
print("控制台断言:")
cs.assert(false,'%s','job1')
cs.assert(true,'%s','job2')