npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lug-log

v0.0.6

Published

NodeJS logging library

Readme

lug-log

NPM

언어

English

lug-log는 node.js 로깅 라이브러리입니다.

기여자 참여하기


이슈 제보: Github 저장소 이슈

새로운 기능: Github 저장소 PR

이슈와 PR은 언제나 환영입니다.

바로 시작하기


const path = require('path');
const lug = require('lug-log');

const logger = lug.createLogger({
    strategies: [
        new.lug.DailyStrategy({
            level: 'info',
            path: path.join(__dirname, '/log'),
            filename: '%DATE%.log',
        }),
        new.lug.DailyStrategy({
            level: 'error',
            path: path.join(__dirname, '/log/error'),
            filename: '%DATE%.error.log',
        }),
    ],
    formatter: (log) => {
        return `${log.level} - ${log.message}`;
    }
});

logger.info('some log')

로그 레벨 LogLevels


debug

info

warn

error

fatal

LogLevels 타입
export type LogLevels =
  'debug'
  | 'info'
  | 'warn'
  | 'error'
  | 'fatal'

로깅 전략


로깅 전략은 로그를 작성할 방법을 설정합니다. createLogger 함수에서 strategies 에 배열로 담아 사용합니다.

1. DailyStrategy

매일 새로운 로그파일을 생성하며 로그를 작성합니다.

생성자 옵션

| 옵션 | 설명 | 기본값 | 필수 | | :------: | :----------------------------------------------------------- | :--------: | :--: | | level | 해당 전략이 로깅할 최소 레벨 | debug | X | | path | 로그 파일을 생성할 경로 (절대 경로) | X | O | | filename | 저장할 파일의 이름'%DATE%'는 필수로 포함되어야하며 'yyyy-MM-dd'로 치환 | %DATE%.log | X |

사용법
new.lug.DailyStrategy({
	level: 'info',
  path: path.join(__dirname, '/log'),
  filename: '%DATE%.log',
}),

서식


출력할 로그의 서식을 설정할 수 있습니다. createLogger 함수에서 formatter 옵션을 통해 설정합니다.

타입

| 대상 | 타입 | | -------- | ------ | | 매개변수 | Log | | 반환 값 | string |

Log 인터페이스

| 속성 | 타입 | 설명 | | --------- | --------- | --------------- | | level | LogLevels | 로그 레벨 | | message | string | 로그 메시지 | | timestamp | number | 로그 타임스탬프 |

사용법
(log) => {
	return 'format your custom log';
}
기본 서식
[level]	- yyyy-MM-dd HH:mm:ss	message