This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@infini-dev/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.38 • Public • Published

Getting Started

Micro logger with levels. Default output is console. Easy to integrate external sources.

Common use case
Anything. For example, we use it to output data on external source like Sentry or Logrocket.

Install

Run of one these command to install.

npm i @infini-dev/logger

or

yarn add @infini-dev/logger

Examples

Default

Output all level.

import {logger} from '@infini-dev/logger'
const {error} = logger()

const saveDocument = (path: string, changes: string) => {
        // ... Implementation

   error("Failed to save..")

    // ... Implementation
}

Debug Log Level

Output debug level.

import {logger} from '@infini-dev/logger'
const {error} = logger({level: "debug"})

const saveDocument = (path: string, changes: string) => {
        // ... Implementation

   error("Failed to save..")

    // ... Implementation
}

External Log

Sends logs to external.

import {logger} from '@infini-dev/logger'

const externalLog = () => {
  //send logs to externalsystem
  }

const myAdapter: ILogger = {
  debug: externalLog,
  info:  externalLog,
  warn:  externalLog,
  error:  externalLog,
  log:  externalLog
};

const {error} = logger({logger: myAdapter})

const saveDocument = (path: string, changes: string) => {
        // ... Implementation

   error("Failed to save..")

    // ... Implementation
}

Powered 🚀 by Infinisoft Inc.


Wanna code the future? Come with us [https://www.infinisoft.world]

Readme

Keywords

none

Package Sidebar

Install

npm i @infini-dev/logger

Weekly Downloads

0

Version

1.0.38

License

Unlicense

Unpacked Size

16.3 kB

Total Files

15

Last publish

Collaborators

  • npm-support