New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tsrt/logger

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsrt/logger

Typescript Reusable Tools: logger

latest
Source
npmnpm
Version
0.8.0
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

Typescript Reusable Tools: Logger

npm version GitHub license Size Downloads

Common customizable logger built on top of awesome Winston.

Important

Until version 1.0.0 Api should be considered as unstable and may be changed.

So prefer using exact version instead of version with ~ or ^.

Usage

import { Logger } from '@tsrt/logger';

const log = new Logger({
  ...
});

API Reference

export declare class Logger {
  constructor(settings?: ILoggerSettings);

  /** Method to setup/update settings after Logger instance was created. */
  setup(settings?: ILoggerSettings): void;

  debug(message: any, _title?: string): Logger;
  verbose(message: any, _title?: string): Logger;
  info(message: any, _title?: string): Logger;
  warn(message: any, _title?: string): Logger;
  error(message: any, _title?: string): Logger;
}

export declare type LoggerLevels = 'verbose' | 'debug' | 'info' | 'warn' | 'error';

export interface ILoggerSettings {
  /** `Winston` Logger level. @default debug. */
  level?: LoggerLevels;

  /** `Winston` Logger env. @default dev. */
  env?: string;

  /** Whether Logger in `prod` mode. In prod mode there is no beautify options used. @default false. */
  prod?: boolean;

  /** Service name, where `Logger` is used. */
  service?: string;

  /** Whether to add Winston `Console` transport by default. @default true. */
  console?: boolean;

  /** Whether to apply custom format. @default true. */
  customFormat?: boolean;

  /** `Winston` Logger `silent` option. @default false. */
  silent?: boolean;

  /** Other `Winston` options. */
  winstonOptions?: LoggerOptions;
}

License

This project is licensed under the terms of the MIT license.

FAQs

Package last updated on 28 Jun 2021

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