Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opengeekslab_llc/nest-custom-logger

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opengeekslab_llc/nest-custom-logger

Logger that prints to output json logs

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

nest-custom-logger

Usage

Simple usage

import { Logger } from '@opengeekslab_llc/nest-custom-logger';

const logger = new Logger(!process.env.NODE_ENV)('Hello');
logger.log('World')

Extended usage

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Logger, requestLoggerMiddleware } from '@opengeekslab_llc/nest-custom-logger';

const port = 8000;

function CustomLogger(context: string) {
  return new Logger(!process.env.NODE_ENV)(context);
}

async function bootstrap() {
  const logger = CustomLogger('NEST');

  const app = await NestFactory.create(AppModule, {
    logger,
  });

  // use this middleware to show http logs in your console
  app.use(requestLoggerMiddleware);

  await app.listen(port);

  logger.log(`app is listening on port ${port}`);
}

bootstrap();

Keywords

FAQs

Package last updated on 19 May 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc