New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

asynclog

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asynclog

logging made easy, useful and scalable

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

asynclog

Logging made easy, useful and scalable

Build Status NPM Version NPM Download Greenkeeper badge

Features

  • Easy to use
  • External transport
  • Event tracking

How to use

  • Include package in your project
npm install --save asynclog
# or, if you are using yarn
yarn add asynclog
  • Start using
const log = require('asynclog')('myApp')

function hello () {
  log('Logging made', 'easy,', 'useful', 'and scalable.')
  log.warn('Not all problems are solved.')
  log.info('And we are actively working to solve them.')
  log.error('Issues:', 'https://github.com/VikramTiwari/asynclog/issues')
  log.trace('Include stacktraces, they make it easier to debug.')
  log.event(0, 'Category', 'Action', 'Label', 0)
}

hello()
  • Enable logging namespace while running program
LOG_NAMESPACE=* node example.js

[Logs Image]

External log providers

  • Google Cloud
# Set ENV variables before running project
LOG_TRANSPORT=google-cloud
GCLOUD_PROJECT_ID=ivikramtiwari # use your project id

Event Tracking

  • Google Analytics
# Set ENV variables before running project
EVENT_TRACKING=google-analytics
GA_TRACKING_ID=UA-20640332-8 # use your tracking id

Environment Variables

ENV VariablePossible ValueUsage
LOG_NAMESPACE*see all logs
myNamespacelog for myNamespace
-myNamespacedon't log myNamespace
LOG_TRANSPORTgoogle-cloudstream logs to google cloud logging
GCLOUD_PROJECT_IDyour-project-idrequired if google-cloud was selected as LGO_TRANSPORT
EVENT_TRACKINGgoogle-analyticsstream event to google analytics
GA_TRACKING_IDUA-12345678-9required if google-analytics was selected as EVENT_TRACKING

Credits

Developer: 👨‍💻 Vikram Tiwari

If you found this library helpful, or learned something from it and want to thank me, consider buying me a cup of ☕️.

Keywords

logging

FAQs

Package last updated on 15 May 2017

Did you know?

Socket

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.

Install

Related posts