All Projects β†’ pinojs β†’ pino-caller

pinojs / pino-caller

Licence: other
🌲 Include call site of pino log messages

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to pino-caller

UnitySettings
Runtime debugging menu (like setting on Android) for Unity.
Stars: ✭ 26 (-25.71%)
Mutual labels:  productivity, utility, debug
Ridereceipts
πŸš• Simple automation desktop app to download and organize your receipts from Uber/Lyft. Try out our new Ride Receipts PRO !
Stars: ✭ 117 (+234.29%)
Mutual labels:  productivity, utility
Goat
POSIX-compliant shell movement boosting hack for real ninjas (aka `cd x` and `cd ...`)
Stars: ✭ 27 (-22.86%)
Mutual labels:  productivity, utility
flawesome
Productivity Tool
Stars: ✭ 56 (+60%)
Mutual labels:  productivity, utility
Goto
Alias and navigate to directories with tab completion in Linux
Stars: ✭ 698 (+1894.29%)
Mutual labels:  productivity, utility
Tip
Programmable tooltip that can be used with any Mac OS app
Stars: ✭ 798 (+2180%)
Mutual labels:  productivity, utility
winston-dev-console
Winston@3 console format aimed to improve development UX
Stars: ✭ 88 (+151.43%)
Mutual labels:  logger, debug
vscode-jump
πŸƒβ€β™‚οΈ Jump/Select to the Start/End of a word in VSCode
Stars: ✭ 67 (+91.43%)
Mutual labels:  productivity, utility
android-sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 39 (+11.43%)
Mutual labels:  logger, debug
linearmouse
πŸ–± The mouse and trackpad utility for Mac.
Stars: ✭ 1,151 (+3188.57%)
Mutual labels:  productivity, utility
Izumi
Productivity-oriented collection of lightweight fancy stuff for Scala toolchain
Stars: ✭ 423 (+1108.57%)
Mutual labels:  productivity, logger
ptkdev-logger
πŸ¦’ Beautiful Logger for Node.js: the best alternative to the console.log statement
Stars: ✭ 117 (+234.29%)
Mutual labels:  logger, pino
vscode-snippet-generator
πŸ“œ Generate snippets from code in VSCode
Stars: ✭ 31 (-11.43%)
Mutual labels:  productivity, utility
Slowquitapps
Add a global delay to Command-Q to stop accidental app quits.
Stars: ✭ 916 (+2517.14%)
Mutual labels:  productivity, utility
powerlet
⚑️ Chrome Extension to quickly find and run bookmarklets
Stars: ✭ 17 (-51.43%)
Mutual labels:  productivity, utility
Synth Shell
Boost your terminal, script by script
Stars: ✭ 217 (+520%)
Mutual labels:  productivity, utility
deno-debug
Debugging utility for deno. Ported from https://npmjs.com/debug
Stars: ✭ 15 (-57.14%)
Mutual labels:  utility, debug
Cabin
🌲 Cabin is the best JavaScript and Node.js logging service and logging npm package
Stars: ✭ 622 (+1677.14%)
Mutual labels:  utility, debug
GoogleCloudLogging
Swift (Darwin) library for logging application events in Google Cloud.
Stars: ✭ 24 (-31.43%)
Mutual labels:  logger, debug
DropPoint
Make drag-and-drop easier using DropPoint. Drag content without having to open side-by-side windows
Stars: ✭ 303 (+765.71%)
Mutual labels:  productivity, utility

pino-caller

npm version Build Status Known Vulnerabilities Coverage Status js-standard-style

Description

pino-caller is a wrapper for pino which adds the call site of each log message to the log output. This can be useful when developing with large codebases in order to locate the exact point where pino is invoked.

Install

For Pino v4 and below use the v2 line, which can be installed with the @legacy tag:

npm install pino-caller@legacy

For Pino v5 and above use the v3+ line, which will install using the usual command:

npm install pino-caller

WARNING: THIS IS A DEVELOPMENT TOOL AVOID PRODUCTION USE!

Usage

Basic

'use strict'

const pino = require('pino')() // it will print as usual
const pinoCaller = require('pino-caller')(pino) // it will print also the calling site

pinoCaller.info('info1')
pinoCaller.error('error1')
pinoCaller.debug('debug1')

Advanced

'use strict'
// dynamically load the plugin if in development environment, output paths relative to __dirname
const pino = process.env.NODE_ENV === 'development' ? require('pino-caller')(require('pino')(), { relativeTo: __dirname }) : require('pino')()

pino.info('info1')
pino.error('error1')
pino.debug('debug1')

You can find also a working example in the examples directory and you can run it with npm run example

Example output

╭─phra at debian in /home/phra/git/pino-caller (master βœ”)
╰─λ npm run example

> [email protected] example /home/phra/git/pino-caller
> env NODE_ENV=development node examples/index.js

{"pid":44837,"hostname":"debian","level":30,"time":1487873713227,"msg":"hello from the module!","caller":"Object.<anonymous> (/home/phra/git/pino-caller/examples/module.js:4:12)","v":1}
{"pid":44837,"hostname":"debian","level":30,"time":1487873713230,"msg":"info1","caller":"Object.<anonymous> (index.js:8:12)","v":1}
{"pid":44837,"hostname":"debian","level":50,"time":1487873713230,"msg":"error1","caller":"Object.<anonymous> (index.js:9:12)","v":1}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].