Skip to content

Instantly share code, notes, and snippets.

@hexode
Last active August 4, 2016 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hexode/2102f5155cc0e9fcac1904037589ec0c to your computer and use it in GitHub Desktop.
Save hexode/2102f5155cc0e9fcac1904037589ec0c to your computer and use it in GitHub Desktop.
Primitive logging
const fs = require('fs');
const logStream = fs.createWriteStream(`${__dirname}/log.txt`, { flags: 'w' });
const log = ((ix = 0) => msg => logStream.write(`${++ix}: ${msg}\n`))();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment