@egomobile/log
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

npm last build PRs Welcome

@egomobile/log

A logging framework written for JavaScript and in TypeScript.

Install

Execute the following command from your project folder, where your package.json file is stored:

npm install --save @egomobile/log

Usage

import log, { LogType } from "@egomobile/log";

// filter: no debug or trace
log.filter((type: LogType, args: any[]) => type <= LogType.Info);

// add one or more custom middlewares
log.use((type: LogType, args: any[]) => {
  // your code
});

// 'log' uses console by default
log("foo"); // default: debug
log.debug("foo"); // debug
log.error("foo"); // error
log.warn("foo"); // warning
log.info("foo"); // information
log.trace("foo"); // trace

Documentation

The API documentation can be found here.

Package Sidebar

Install

npm i @egomobile/log

Weekly Downloads

0

Version

0.3.0

License

LGPL-3.0

Unpacked Size

35.1 kB

Total Files

12

Last publish

Collaborators

  • ekmobile
  • egodux
  • mkloubertego
  • mkloubert
  • ekegodigital