Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
adding error handling incase the config logging option is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Nov 6, 2014
1 parent d2d4e8c commit 5598caf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions config/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ module.exports = {
getLogOptions: function() {
var options = {};

if ('stream' in config.log.options) {
options = {
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
};
try {
if ('stream' in config.log.options) {
options = {
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
};
}
} catch (e) {
options = {};
}

return options;
Expand Down

0 comments on commit 5598caf

Please sign in to comment.