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

1.0.21 • Public • Published

tomatoes-logger

Lightweight front end logging tool

Installing

$ yarn add @tomatoes/logger

Functions

/**
 * initialization
 */
function init(conf?: InitConf): void;
/**
 * Configuration
 */
function config(level: Level, opts: ConfigLogger): void | string /**errMsg */;
/**
 * Global status
 */
function disabled(bool?: boolean): void | string /**errMsg */;
/**
 * Clear log
 */
function clear(): void | string /**errMsg */;
/**
 * logger
 */
function logger(prefix?: string): LogFunc;

Usage

import logger, { init, config, Enum, disabled } from "@tomatoes/logger";

init(/** { prefix: "[-] ", unDeclare: false, disabled: false } */);

// config(Enum.Level.INFO, { prefix: "--->", color: Enum.Color.WHITE });

// disabled()

logger().error('error') //error message
logger().warn('warn')
logger('::').error({a: 1, b: 2})
logger().debug('debug')
logger().info('info')
logger().info(1)
logger().info(true)

License

The ISC License

Package Sidebar

Install

npm i @tomatoes/logger

Weekly Downloads

4

Version

1.0.21

License

ISC

Unpacked Size

10.8 kB

Total Files

15

Last publish

Collaborators

  • g0ngjie