This repository has been archived by the owner on Jan 7, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve logging during tests, so debug logs can be output to a file.
This is preferable for tests, so we don't have to always worry about having quiet output and can better debug things during testing.
- Loading branch information
Showing
4 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
/test/config/overrides.yml | ||
/test/config/runtime.json | ||
/test/config/runtime.yml* | ||
/test/log/* | ||
/test/tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
var Log = require('log'); | ||
var fs = require('fs'), | ||
Log = require('log'); | ||
|
||
var logLevel = process.env.NODE_LOG_LEVEL || 'info'; | ||
var logger = new Log(logLevel); | ||
var logLevel = process.env.API_UMBRELLA_LOG_LEVEL || 'info'; | ||
var stream = process.stdout; | ||
if(process.env.API_UMBRELLA_LOG_PATH) { | ||
stream = fs.createWriteStream(process.env.API_UMBRELLA_LOG_PATH, { | ||
flags: 'a' | ||
}); | ||
} | ||
|
||
var logger = new Log(logLevel, stream); | ||
module.exports = logger; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
|
||
process.env.NODE_ENV = 'test'; | ||
process.env.NODE_LOG_LEVEL = 'error'; | ||
process.env.API_UMBRELLA_LOG_LEVEL = 'debug'; | ||
process.env.API_UMBRELLA_LOG_PATH = path.resolve(__dirname, '../log/test.log'); |