File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 24
24
25
25
# Port number to listen on
26
26
port : 8080
27
+
28
+ # Log level for Winston's file transports (set to `error` to reduce logging to a minimum)
29
+ # winston_file_log_level: error
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ var CONFIG_DIR = process.env.CONFIG_DIR || process.cwd(),
34
34
// The topic type to send state changes to smartthings
35
35
TOPIC_WRITE_STATE = 'set_state' ,
36
36
SUFFIX_WRITE_STATE = 'state_write_suffix' ,
37
+ WINSTON_FILE_LOG_LEVEL = 'winston_file_log_level' ,
37
38
RETAIN = 'retain' ;
38
39
39
40
var app = express ( ) ,
@@ -137,6 +138,11 @@ function migrateState (version) {
137
138
config . port = 8080 ;
138
139
}
139
140
141
+ // Default file transport logging level
142
+ if ( ! config [ WINSTON_FILE_LOG_LEVEL ] ) {
143
+ config [ WINSTON_FILE_LOG_LEVEL ] = 'info' ;
144
+ }
145
+
140
146
// Default protocol
141
147
if ( ! url . parse ( config . mqtt . host ) . protocol ) {
142
148
config . mqtt . host = 'mqtt://' + config . mqtt . host ;
@@ -323,6 +329,8 @@ async.series([
323
329
winston . info ( 'Perfoming configuration migration' ) ;
324
330
migrateState ( state . version ) ;
325
331
332
+ winston . default . transports . file . level = config [ WINSTON_FILE_LOG_LEVEL ] ;
333
+
326
334
process . nextTick ( next ) ;
327
335
} ,
328
336
function connectToMQTT ( next ) {
You can’t perform that action at this time.
0 commit comments