Logger
Piscosour has a feature to generate a sequential data to stdin or stderr inside a step.
Example of use:
run: function() {
this.logger.info('#green', 'text');
}
There are 6 levels:
Error
this.logger.error(msg, ...)
outputs a msg to stderr.
Param | Type | Optional | Description |
---|---|---|---|
msg | Object | No | Outputs the object to stderr, except it is a Color. Colors are specified like '#color' , when color has been specified, then next parameter will be coloured with the last color. Please see chalk library to see which colors are supported. |
Example:
run: function() {
this.logger.error('#green', 'text', '#blue', 'text2', { key1: 'value2' });
}
Shows colored message:
[12:08:54] run stage running...
[12:08:54] text text2 { key1: 'value2' }
Where test
is green and test2
is blue.
Warning
this.logger.warn(msg, ...)
warn a msg to stdout. By default warn message are showed in console.
Param | Type | Optional | Description |
---|---|---|---|
msg | Object | No | Outputs the object to stderr, except it is a Color. Colors are specified like '#color' , when color has been specified, then next parameter will be coloured with the last color. Please see chalk library to see which colors are supported. |
Example:
run: function() {
this.logger.warn('#green', 'text', '#blue', 'text2', { key1: 'value2' });
}
Shows colored message:
[12:08:54] run stage running...
[12:08:54] text text2 { key1: 'value2' }
Where test
is green and test2
is blue.
Info
this.logger.info(msg, ...)
info a msg to stdout. By default warn message are showed in console.
Param | Type | Optional | Description |
---|---|---|---|
msg | Object | No | Outputs the object to stderr, except it is a Color. Colors are specified like '#color' , when color has been specified, then next parameter will be coloured with the last color. Please see chalk library to see which colors are supported. |
Example:
run: function() {
this.logger.info('#green', 'text', '#blue', 'text2', { key1: 'value2' });
}
Shows colored message:
[12:08:54] run stage running...
[12:08:54] text text2 { key1: 'value2' }
Where test
is green and test2
is blue.
Verbose
this.logger.trace(msg, ...)
trace a msg to stdout. By default verbose message are not showed in console (see Command Line Interface for more information).
Param | Type | Optional | Description |
---|---|---|---|
msg | Object | No | Outputs the object to stderr, except it is a Color. Colors are specified like '#color' , when color has been specified, then next parameter will be coloured with the last color. Please see chalk library to see which colors are supported. |
Example:
run: function() {
this.logger.trace('#green', 'text', '#blue', 'text2', { key1: 'value2' });
}
When it is executed with -ov
option (see Command Line Interface) shows colored message:
[12:08:54] run stage running...
[12:08:54] text text2 { key1: 'value2' }
Where test
is green and test2
is blue.
Debug
this.logger.debug(msg, ...)
info a msg to stdout. By default debug message are not showed in console (see Command Line Interface for more information).
Param | Type | Optional | Description |
---|---|---|---|
msg | Object | No | Outputs the object to stderr, except it is a Color. Colors are specified like '#color' , when color has been specified, then next parameter will be coloured with the last color. Please see chalk library to see which colors are supported. |
Example:
run: function() {
this.logger.debug('#green', 'text', '#blue', 'text2', { key1: 'value2' });
}
When it is executed with -od
option (see Command Line Interface), shows colored message:
[12:08:54] run stage running...
[12:08:54] text text2 { key1: 'value2' }
Silly
this.logger.silly(msg, ...)
shows a silly msg to stdout. By default silly message are not showed in console (see Command Line Interface for more information).
Param | Type | Optional | Description |
---|---|---|---|
msg | Object | No | Outputs the object to stderr, except it is a Color. Colors are specified like '#color' , when color has been specified, then next parameter will be coloured with the last color. Please see chalk library to see which colors are supported. |
Example:
run: function() {
this.logger.silly('#green', 'text', '#blue', 'text2', { key1: 'value2' });
}
When it is executed with -ov
option (see Command Line Interface), shows colored message:
[12:08:54] run stage running...
[12:08:54] text text2 { key1: 'value2' }
Command Line Interface
To show all errors to an specific level, please use one of the following options:
$ pisco --output ( verbose | debug | silly ) [ -ov | -od | -os]
Examples:
$ pisco --output verbose
Or
$ pisco -ov