
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
node-tiny-logger
Advanced tools
A very tiny logger for nodejs
npm install --save node-tiny-logger
import Logger from 'node-tiny-logger'
const logger = new Logger({
level: Logger.INFO
})
logger.warn('some warning', {someObject: 1}, ...)
{
level: Logger.FATAL | Logger.ERROR | Logger.WARN | Logger.INFO | Logger.DEBUG | Logger.TRACE,
handleLogEntry?: (levelStr: string, argsPassedToLog),
stream?: NodeJS.WritableStream
}
level:
All logs below this level will be ignored. Eg: If you specify Logger.WARN, then log.error() will work, but log.info() will be ignored
handleLogEntry(levelStr: string, argsPassedToLog):
Optional log entry handler. If you provide it then logs will trigger options.handleLogEntry function instead of writing to options.stream (or process.stdout).
Eg:
const logger = new Logger({
handleLogEntry: function(levelStr, args) {
console.log(levelStr, args)
}
})
logger.error("a", 1, 2); // => ERROR [ 'a', 1, 2 ]
stream:
If provided (and handleLogEntry is not provided) then it will be used to write log. Defaults to process.stdout
FAQs
A very tiny nodejs logger
We found that node-tiny-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.

Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.

Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.