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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@makestory/logging-manager

v1.0.0

Published

로그 관리

Downloads

4

Readme

로그(console) 관리

특정버전 호환이 필요한 의존성 모듈은 package.json 에 peerDependencies 항목에도 의존성 패키지 및 버전 명시 필수!

패키지를 사용하는 쪽에 현재 패키지가 의존하는 라이브러리 버전 설치 필수라는 것 명시!
실제로 패키지에서 직접 require(import) 하지는 않더라도 호환성이 필요한 경우 명시!

example

import { useEffect } from 'react';
import { LOG_LEVEL, LOG_GROUP_KEY, logger } from '@lotte/logging-manager';

const LogTest = () => {
  useEffect(() => {
    // 로그레벨 수동 지정, 출력함수 수동 지정
    logger(LOG_LEVEL.ERROR, console.debug, 'test1', 'test-1');

    // 로그레벨 수동 지정, 출력함수 수동 지정
    logger(LOG_LEVEL.WARN)(console.log)('test2', 'test-2');

    // 출력함수 수동 지정
    logger(console.warn)('test3', 'test-3');

    // 단순 로그 출력
    logger('test4', 'test-4');

    // 로그레벨 제공 함수에 따른 로그 출력
    logger.error('test5', 'test-5');
    logger.warn('test6', 'test-6');
    logger.info('test7', 'test-7');
    logger.debug('test8', 'test-8');

    // 로그그룹 지정 - URL 파라미터에 해당 로그 그룹을 지정할 경우, 다른 로그는 자동 숨김처리
    logger({ level: LOG_LEVEL.WARN, [LOG_GROUP_KEY]: LOG_LEVEL.WARN })(
      `로그 그룹을 "${LOG_LEVEL.WARN}" 라는 값으로 설정!`,
    );
    logger({ level: LOG_LEVEL.ERROR, [LOG_GROUP_KEY]: 'test' })(
      '로그 그룹을 "test" 라는 값으로 설정!',
    );

    // 로그 수동 지정 후 이를 재활용
    const log = logger(LOG_LEVEL.WARN)(console.log);
    log('1');
    log('2', '3');
  }, []);

  return <></>;
};

export default LogTest;