0.9.24 • Published 3 years ago

vv-mssql-logger v0.9.24

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Install & Use

npm i vv-mssql-logger
const lib_mssql_logger = require('vv-mssql-logger')

let logger = lib_mssql_logger.create({
    timezone_minutes: 180,
    schema: 'vv',
    table: 'log',
    time_save_seconds: 10,
    time_life_seconds: 345600
})

//EXEC THIS QUERY BY YOUR MS SQL DRIVER:
//logger.query_create_tables()

lib_mssql_logger.on_save(logger, params => {
    //EXEC THIS QUERY BY YOUR MS SQL DRIVER:
    //params.query
})
lib_mssql_logger.on_delete(logger, params => {
    //EXEC THIS QUERY BY YOUR MS SQL DRIVER:
    //params.query
})
lib_mssql_logger.on_add(logger, log => {
    console.log(log)
})

logger.trace_for_all_log_add('app name', 'my best app')
logger.pipe_on() //turn on empty pipe
logger.log('hello 1 (no ignored, because empty pipe)')
logger.log('hello 2 (no ignored too)', {traces: {key: 't1', data: 'd1'}} )
logger.log('hello 3 (ignored, because "my pipe" turned off)', {pipes: 'my pipe'})
logger.pipe_on('my pipe') //turn on "my pipe" pipe
logger.log('hello 3 (no ignored)', {pipes: 'my pipe'})

App

Kind: global class

new App(options)

ParamType
optionstype.constructor_options

app._env : type.env

Kind: instance property of App

app.pipe_on(pipe)

add pipe for which you need to enable logging

Kind: instance method of App

ParamType
pipestring

app.pipe_off(pipe)

add pipe for which you need to disable logging

Kind: instance method of App

ParamType
pipestring

app.trace_for_all_error_add(key, data)

adding information to be added to all error

Kind: instance method of App

ParamType
keystring
datastring

app.trace_for_all_log_add(key, data)

adding information to be added to all log

Kind: instance method of App

ParamType
keystring
datastring

app.trace_for_all_error_remove(key)

see trace_for_all_error_add

Kind: instance method of App

ParamType
keystring

app.trace_for_all_log_remove(key)

see trace_for_all_log_add

Kind: instance method of App

ParamType
keystring

app.error(message, options)

write error

Kind: instance method of App

ParamType
messagestring | Error
optionstype.message_options

app.log(message, options)

write log

Kind: instance method of App

ParamType
messagestring
optionstype.message_options

app.save()

force save buffer to database

Kind: instance method of App

0.9.24

3 years ago

0.9.23

3 years ago

0.9.22

4 years ago

0.9.21

4 years ago

0.9.20

4 years ago

0.9.19

4 years ago

0.9.17

4 years ago

0.9.16

4 years ago

0.9.15

4 years ago

0.9.14

4 years ago

0.9.13

4 years ago

0.9.12

4 years ago

0.9.11

4 years ago

0.9.10

4 years ago

0.9.9

4 years ago

0.9.8

4 years ago

0.9.7

4 years ago

0.9.4

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago