Socket
Socket
Sign inDemoInstall

@lemoncloud/lemon-logger-lib

Package Overview
Dependencies
3
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lemoncloud/lemon-logger-lib

lemon logger library


Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
3
Install size
3.88 MB
Created
Weekly downloads
 

Readme

Source

lemon-logger-lib

Build Status

TypeScript console logger for LemonCloud

Install

$ npm install lemon-logger-lib

Usage

default

import { Logger } from 'lemon-logger-lib';

const logger = new Logger('LEMON');
const logger2 = new Logger('LEMON2', { showTimestamp: false, showLogType: false });

logger.log('this is log', 'extra params: ', { type: 'debug'}); 
logger.debug('this is debug', 'extra params: ', { type: 'debug'});

logger2.info('this is info', 'extra params: ', { type: 'info'});
logger2.warn('this is warn', 'extra params: ', { type: 'warn'});
logger2.error('this is error', 'extra params: ', { type: 'error'}, 'test');

http

const logger = new Logger('LEMON', {
    shouldSend: true,
    httpHost: 'http://localhost:8333',
    httpMethod: 'POST',
    httpPath: '/mock/log',
});

socket

const logger = new Logger('LEMON', {
    useSocket: true,
    socketHost: 'http://localhost:5555',
    socketEvent: 'LOG',
});

Options

Logger([namespace], [options])

showTimestamp

Type: boolean
Default: true

showLogType

Type: boolean
Default: true

shouldSend

Type: boolean
Default: false

httpHost

Type: string
Default: ''

httpMethod

Type: string
Default: ''

httpPath

Type: string
Default: ''

useSocket

Type: boolean
Default: false

socketHost

Type: string
Default: ''

socketEvent

Type: string
Default: ''

Methods

logger.log('test message')
logger.debug('test message')
logger.info('test message')
logger.warn('test message')
logger.error('test message')
logger.setOptions({ shouldSend: false })
logger.closeSocket()

Sample

A quick sample is provided as example.js

FAQs

Last updated on 26 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc