Skip to content

Instantly share code, notes, and snippets.

@ryanhamley
Created November 5, 2015 18:37
Show Gist options
  • Select an option

  • Save ryanhamley/d159efd41b0c67b0067d to your computer and use it in GitHub Desktop.

Select an option

Save ryanhamley/d159efd41b0c67b0067d to your computer and use it in GitHub Desktop.

Revisions

  1. ryanhamley created this gist Nov 5, 2015.
    7 changes: 7 additions & 0 deletions nodeFileLogger.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    var log_file = fs.createWriteStream(__dirname + '/debug.log', {flags : 'w'});
    var log_stdout = process.stdout;

    console.log = function(d) { //
    log_file.write(util.format(d) + '\n');
    log_stdout.write(util.format(d) + '\n');
    };