bunyan-buddy
Reduce the amount of Bunyan boilerplate code required with integration for Google Cloud Logging, ideal when working with microservices.
bunyan-buddy sets up a local stream using bunyan-prettystream (https://github.com/MaximusHaximus/node-bunyan-prettystrea) and a remote stream using @google-cloud/logging-bunyan. You can set the log levels for each using environment variables or as options when initializing it. For testing Google Cloud Logging locally, you can manually auth with it using a service account file.
Usage
const log = app: name: 'my-app-name' // defaults to 'app' version: '1.0.0' // defaults to undefined local_level: 'debug' // defaults to process.env.LOG_LEVEL_LOCAL or 'info' remote_level: 'info' // defaults to process.env.LOG_LEVEL_REMOTE or not set // optionally auth with google cloud logging // defaults to not set (auth is automatic if hosted on Google Cloud Platform) remote_auth: projectId: 'my-google-cloud-project' keyFilename: '/path/to/gcloud-auth.json' }; log; log; log; log;