File tree Expand file tree Collapse file tree 3 files changed +28
-14
lines changed Expand file tree Collapse file tree 3 files changed +28
-14
lines changed Original file line number Diff line number Diff line change 11/**
22 * logger for create logFile as lambda_api.log to current dir if path is not passed by User.
33 */
4- var winston = require ( "winston" ) ;
5- module . exports = function ( logFile ) {
6- var winstonFormat = winston . format ;
7- return winston . createLogger ( {
8- level : "info" ,
9- format : winstonFormat . combine (
10- winstonFormat . timestamp ( ) ,
11- winstonFormat . json ( )
12- ) ,
13- transports : [ new winston . transports . File ( { filename : logFile ? logFile : "lambda_api.log" } ) ]
14- } ) ;
15- } ;
4+ var winston = require ( "winston" ) ;
5+
6+ function logging ( logFile ) {
7+ var winstonFormat = winston . format ;
8+ if ( process . env . LT_API_LOG === "true" ) {
9+ return winston . createLogger ( {
10+ level : "info" ,
11+ format : winstonFormat . combine (
12+ winstonFormat . timestamp ( ) ,
13+ winstonFormat . json ( )
14+ ) ,
15+ transports : [ new winston . transports . File ( { filename : logFile ? logFile : "lambda_api.log" } ) ]
16+ } ) ;
17+ }
18+ return winston . createLogger ( {
19+ level : "info" ,
20+ silent :"true" ,
21+ format : winstonFormat . combine (
22+ winstonFormat . timestamp ( ) ,
23+ winstonFormat . json ( )
24+ ) ,
25+ transports : [ new winston . transports . Console ( ) ]
26+ } ) ;
27+
28+ } ;
29+ module . exports = logging
Original file line number Diff line number Diff line change 11{
22 "name" : " @lambdatest/node-rest-client" ,
3- "version" : " 1.0.7 " ,
3+ "version" : " 1.0.8 " ,
44 "description" : " LambdaTest Rest Client for Node.js" ,
55 "main" : " index.js" ,
66 "repository" : {
You can’t perform that action at this time.
0 commit comments