1.0.3 • Published 9 months ago

tydet-core-logger v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

TyDeT Core Logger

A Typescript & Javascript library for TyDeT Core to handle logs across the context of the core app.

TyDeT (Typescript Developer Tools) Core Logger is a module for TyDeT Core to handle log events across the Context of the core backend app.

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

npm install tydet-core tydet-core-logger

It is required to install TyDeT Core to use this module.

Usage

Basic usage

import { Context } from 'tydet-core';
import { Logger, LoggerMode, LogLevel } from 'tydet-core-logger';

let app = new Context()
let logger = new Logger([
  {
    mode: LoggerMode.CONSOLE,
    min: LogLevel.INFO
  },
  {
    mode: LoggerMode.FILE,
    path: "./logs/today.log"
    max: LogLevel.SUCCESS
  },
  {
    mode: LoggerMode.WEBHOOK,
    endpoint: "https://mywebhookserver.com/logs",
    only: [LogLevel.ERROR, LogLevel.WARNING]
  }
])
await app.mountService("logger", logger)

logger.debug("This is a debug message")
logger.info("This is an info message")
logger.success("This is a success message")
logger.failure("This is a failure message")
logger.warn("This is a warning message")
logger.error("This is an error message")

Check the docs for more details about the service.

Changelog

Learn about the latest improvements.

License

MIT License.

Contributing

We'd love for you to contribute to TyAPI Core Logger and help make it even better than it is today! Find out how you can contribute here.

1.0.2

9 months ago

1.0.3

9 months ago

1.0.1

1 year ago

1.0.0

1 year ago