🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@koakh/typescript-simple-logger

Package Overview
Dependencies
Maintainers
0
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koakh/typescript-simple-logger

a simple logger implementation, without dependencies...

1.1.16
latest
npm
Version published
Weekly downloads
14
-70.83%
Maintainers
0
Weekly downloads
 
Created
Source

README

a simple logger implementation, without dependencies...

  • GitHub
  • NPM

Usage

use like that

add to .env

# logLevel
LOG_LEVEL=ERROR

constants.ts

// env constants
const LOG_LEVEL: LogLevel = (process.env.LOG_LEVEL) ? getEnumKeyFromEnumValue(LogLevel, process.env.LOG_LEVEL) : LogLevel.ERROR;
import { Logger, LogLevel } from '@koakh/typescript-simple-logger';

export class App {
  // static
  public static log(logLevel: LogLevel, message: string | object) {
    App.logger.log(logLevel, message);
  }
  private static logger: Logger = new Logger(c.LOG_LEVEL, c.LOG_FILE_PATH);

  constructor() {
    App.log(LogLevel.INFO, 'some message');
  }
}

// init App
export default new App();

Keywords

logger

FAQs

Package last updated on 20 Dec 2024

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