New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@omnicar/sam-log

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omnicar/sam-log

Handles logging to console and to stackdriver

  • 1.2.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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 👍

FAQs

Package last updated on 01 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc