GithubHelp home page GithubHelp logo

sam-log's Introduction

SAM-log

Usage

The default settings should make sure that no initialisation of the library is needed for Omnicar's applications. The only prerequisite to having the library default to sane environment specific loglevels is having the NODE_ENV environment variable available (set to: production | staging | development | local)

Another option is to have the LOG_LEVEL environment variable available (has to be one of: error | warn | info | verbose | debug | silly) which will set/override the loglevel directly

To use the library, simply import the log function needed. E.g. logError and use it like a regular call to console.error

It's possible to use an optional prefix for all the logging methods. The available logging methods are:

  • logError(message: string | object, info?: ILogInfo)
  • logWarn(message: string | object, info?: ILogInfo)
  • logInfo(message: string | object, info?: ILogInfo)
  • logVerbose(message: string | object, info?: ILogInfo)
  • logDebug(message: string | object, info?: ILogInfo)

Developing

Pull the project, run yarn and you should be good

Before you do a git push, please run yarn tsc-once to generate the build folder contents

Testing

There are a bunch of jest tests in the index.test.ts file. Run yarn test to run all tests, yarn test-watch to run them in watch-mode, and run yarn test-debug to run them in watch mode with --inspect enabled (allowing you to step debug)

Releasing

Releasing a new version is done as a Github release.

The Github release will automatically trigger a build in Circle that publishes the new version to npm ๐Ÿ‘

sam-log's People

Contributors

erik-beus avatar mkock avatar renovate[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.