0.3.6 • Published 9 years ago
@novavisionspa/eva-logs v0.3.6
eva-logs
Config via ENV VARS
simply set this environment varables in your app via the resin dashboard to configure the behavour of your devices
winston variables:
EVALOGS_WINSTONstring or boolean - the flag to active or disable winstonEVALOGS_INFO_LOGFILEstring - the PATH to be loaded. defaults to/data/filelog-info.logEVALOGS_WARNING_LOGFILEstring - the PATH to be loaded. defaults to/data/filelog-warning.logEVALOGS_ERROR_LOGFILEstring - the PATH to be loaded. defaults to/data/filelog-error.logEVALOGS_DANGER_LOGFILEstring - the PATH to be loaded. defaults to/data/filelog-danger.log
sami variables:
EVALOGS_SAMIstring or boolean - the flag to active or disable samiEVALOGS_SAMI_BASE_URLstring - the BASE URL of sami api. defaults tohttps://api.samsungsami.io/v1.1EVALOGS_SAMI_USER_TOKENstring - the sami USER TOKEN. deafaults tobe8d0f5de9534bef9d4b2fa3aa224a5cDEAFULT TEMPORARYEVALOGS_SAMI_DEVICE_TYPE_IDstring - the sami DEVICE TYPE ID. defaults todtab57a70a040f46bea42c7ae389de5142DEFAULT TEMPORARYEVALOGS_SAMI_DEVICE_UUIDstring - the PATH to be loaded. defaults toprocess.env.RESIN_UUIDortestdeviceuuidDEAFULT TEMPORARY
INSTALLATION
npm i @novavisionspa/eva-logsUSAGE
logger.config(function(){
logger.log("info","tester","unit testing this module",{ "int":1, "string": "lorem ipsum", "array": [0,1,2,3], "obj": { "1": 1, "2": 2}});
logger.log("error","tester","unit testing this module",{ "int":1, "string": "lorem ipsum", "array": [0,1,2,3], "obj": { "1": 1, "2": 2}});
logger.log("warning","tester","unit testing this module",{ "int":1, "string": "lorem ipsum", "array": [0,1,2,3], "obj": { "1": 1, "2": 2}});
logger.log("danger","tester","unit testing this module",{ "int":1, "string": "lorem ipsum", "array": [0,1,2,3], "obj": { "1": 1, "2": 2}});
});