npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ciklum/logan

v0.4.10

Published

Logging library

Downloads

12

Readme

LOGAN - extended logger service for you javascript app, or super nice guy.

Table of contents

  1. Installation and usage
  2. Log levels
  3. Usage and API
  4. Working with local copy of module
  5. Publish a package

Installation and usage

Set private registry by adding registry=http://npm.pp.ciklum.com/ to your .npmrc file

Install LOGAN library by running

npm i @ciklum/logan

Now you can use LoggerService class provided by RAAX:

import { LoggerService } from '@ciklum/logan'

Log levels

LoggerService supports next types of log levels:

  • log
  • debug
  • info
  • warn
  • error

Current log level is provided by:

  • LOG_LEVEL environment variable for Node.js applications
  • window.config.logLevel for browser applications

Current log level determines what messages should be displayed. For example, if current log level is set to 'info' (window.config.logLevel = 'info') only info, warn and error messages will be displayed. log and debug messages will be ignored.

Usage and API

To start using LoggerService:

import { LoggerService } from '@ciklum/logger'

const logger = new LoggerService()

To set global title for LogerService (for all LoggerServices in the application):

LoggerService.setGlobalTitle('delivery-flow-app')

To set a title for LoggerService (for LoggerServices instance):

logger.setTitle('@ciklum/xmess')

// Log output if global and instance titles are set:
// [delivery-flow-app::@ciklum/xmess]

There are five methods to output logs:

  • logger.log
  • logger.debug
  • logger.info
  • logger.warn
  • logger.error

Note: Starting with Chromium 58 loger.debug method only appears in Chromium browser consoles when level "Verbose" is selected (not set by default).

Message string and optional argument(s) of any type should be passed to these methods:

logger.info('Publish', { channelHeader, listeners: cbs.length, msg })

// Log output
// [delivery-flow-app::@ciklum/xmess] Publish > {channelHeader: "@ciklum-sol-js/xmess:todos/items/all-get:success", listeners: 0, msg: Array(10)}

Working with local copy of module

When you want to develop new features for module, this section will be helpful for you. Package linking is a two-step process which solves this need. You need npm link for this.

Steps:

  • Create global link. It will be available in folder were your npm modules are.

    npm link

  • Links to the global installation target from your front end app.

    npm link @ciklum/logan

Publish a package

Publish a package to the registry by running

npm run build
npm publish