2.0.7 • Published 5 years ago

viva-logger v2.0.7

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
5 years ago

Classes

Functions

Typedefs

Logger

(license MIT) text logger, full example - see example.js

Kind: global class

logger.path

{string}

Kind: instance property of Logger

logger.path_trace

{string}

Kind: instance property of Logger

logger.pipe_unnamed

{boolean}

Kind: instance property of Logger

logger.pipe_list

{string[]}

Kind: instance property of Logger

logger.write_to_file

{boolean}

Kind: instance property of Logger

logger.write_to_file

{boolean}

Kind: instance property of Logger

logger.init(path, write_to_file, write_to_console) ⇒ string

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

ParamTypeDescription
pathstringroot path for text log files, if empty - set __dirname/log
write_to_fileboolean
write_to_consoleboolean

logger.turnOn(pipe, log_this_command)

turn on logger

Kind: instance method of Logger

ParamTypeDescription
pipestringlogger pipe
log_this_commandbooleanwrite to log event 'TURN_ON', default - false

logger.turnOff(pipe, log_this_command)

turn off logger

Kind: instance method of Logger

ParamTypeDescription
pipestringlogger pipe
log_this_commandbooleanwrite to log event 'TURN_OFF', default - false

logger.debug(message, pipe, trace_objects, additional_param) ⇒ type_write_result

save message as debug

Kind: instance method of Logger
Returns: type_write_result - result write debug

ParamTypeDescription
messagestringmessage
pipeArray.<string> | stringlogger pipe
trace_objectsany | Array.<any>trace object list
additional_paramtype_additional_param | Array.<type_additional_param>additional params, contat to message

logger.error(error, pipe, trace_objects, additional_param) ⇒ type_write_result

save message as error

Kind: instance method of Logger
Returns: type_write_result - result write error

ParamTypeDescription
erroranyobject error or error text
pipestring | Array.<string>logger pipe
trace_objectsany | Array.<any>trace object list
additional_paramtype_additional_param | Array.<type_additional_param>additional params, contat to message

console_log(allow, text)

Kind: global function

ParamType
allowboolean
textstring

console_error(allow, text)

Kind: global function

ParamType
allowboolean
textstring

type_message

Kind: global typedef
Properties

NameType
ddDate
typestring
messagestring
message_corestring
pipesArray.<string>
trace_objectsany | Array.<any>
additional_paramsArray.<type_additional_param>
write_resulttype_write_result

type_write_result

Kind: global typedef
Properties

NameTypeDescription
debug_filestringdebug full file name
error_filestringerror full file name
trace_filestringtrace full file name

type_additional_param

part message with format {key: value}

Kind: global typedef
Properties

NameType
keystring
valuestring

type_writefiles

Kind: global typedef

ParamTypeDescription
filesArray.<type_writefiles>
callbackfunctionerror

Properties

NameTypeDescription
file_namestring
file_datastringasync write many files with one callback
2.0.7

5 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago