text logger
Homepage Repository npm Download
(license MIT) text logger, full example - see example.js
Kind: global class
{string}
Kind: instance property of Logger
{string}
Kind: instance property of Logger
{boolean}
Kind: instance property of Logger
{string[]}
Kind: instance property of Logger
{boolean}
Kind: instance property of Logger
{boolean}
Kind: instance property of Logger
initialization logger, set root path for storage text log files
Kind: instance method of Logger
Returns: string - full path name for storage text log files
Param | Type | Description |
---|---|---|
[path] | string | root path for text log files, if empty - set __dirname/log |
[write_to_file] | boolean | |
[write_to_console] | boolean |
turn on logger
Kind: instance method of Logger
Param | Type | Description |
---|---|---|
[pipe] | string | logger pipe |
[log_this_command] | boolean | write to log event 'TURN_ON', default - false |
turn off logger
Kind: instance method of Logger
Param | Type | Description |
---|---|---|
[pipe] | string | logger pipe |
[log_this_command] | boolean | write to log event 'TURN_OFF', default - false |
save message as debug
Kind: instance method of Logger
Returns: type_write_result - result write debug
Param | Type | Description |
---|---|---|
message | string | message |
[pipe] | Array.<string> | string | logger pipe |
[trace_objects] | any | Array.<any> | trace object list |
[additional_param] | type_additional_param | Array.<type_additional_param> | additional params, contat to message |
save message as error
Kind: instance method of Logger
Returns: type_write_result - result write error
Param | Type | Description |
---|---|---|
error | any | object error or error text |
[pipe] | string | Array.<string> | logger pipe |
[trace_objects] | any | Array.<any> | trace object list |
[additional_param] | type_additional_param | Array.<type_additional_param> | additional params, contat to message |
Kind: global function
Param | Type |
---|---|
allow | boolean |
text | string |
Kind: global function
Param | Type |
---|---|
allow | boolean |
text | string |
Kind: global typedef
Properties
Name | Type |
---|---|
dd | Date |
type | string |
message | string |
message_core | string |
pipes | Array.<string> |
[trace_objects] | any | Array.<any> |
additional_params | Array.<type_additional_param> |
write_result | type_write_result |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
debug_file | string | debug full file name |
error_file | string | error full file name |
trace_file | string | trace full file name |
part message with format {key: value}
Kind: global typedef
Properties
Name | Type |
---|---|
key | string |
value | string |
Kind: global typedef
Param | Type | Description |
---|---|---|
files | Array.<type_writefiles> | |
[callback] | function | error |
Properties
Name | Type | Description |
---|---|---|
file_name | string | |
file_data | string | async write many files with one callback |