Last active
August 4, 2016 07:32
-
-
Save hexode/2102f5155cc0e9fcac1904037589ec0c to your computer and use it in GitHub Desktop.
Primitive logging
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
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