Skip to main content

Custom logging utility

Project description

Custom Logger Package

개요

이 프로젝트는 Python 애플리케이션을 위한 사용자 정의 로깅 설정을 제공합니다. setup_logger 함수를 사용하면, 애플리케이션의 다양한 부분에서 일관된 로깅 설정을 적용할 수 있습니다. 로그 파일은 호출하는 스크립트가 위치한 디렉토리에 생성됩니다.

기능

  • 로그 파일 자동 생성: 스크립트 실행 위치에 기반한 로그 디렉토리에 로그 파일을 자동으로 생성합니다.
  • 쉬운 통합: 다양한 Python 스크립트에서 쉽게 사용할 수 있습니다.
  • 사용자 정의 가능: 로그 디렉토리와 로거 이름을 사용자가 정의할 수 있습니다.

설치 방법

이 패키지는 아직 공식 Python 패키지 저장소에 등록되지 않았기 때문에, GitHub 레포지토리나 내부 패키지 저장소를 통해 설치해야 합니다.

pip install waylake-utils

사용 방법

  1. 패키지를 import합니다.
from waylake import setup_logger
  1. 로거를 설정합니다. __file__을 인자로 전달하여 현재 스크립트의 위치에 로그 파일을 생성합니다.
logger = setup_logger('my_logger_name', __file__)
logger = setup_logger(name='logger_name', caller_file=__file__, log_dir='./logs')
  1. 로그를 기록합니다.
logger.info("This is an info message")
logger.error("This is an error message")

라이선스

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waylake_utils-0.1.4.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file waylake_utils-0.1.4.tar.gz.

File metadata

  • Download URL: waylake_utils-0.1.4.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for waylake_utils-0.1.4.tar.gz
Algorithm Hash digest
SHA256 aa5a05904e9f34825cf4427038f4e73ff4c9225feb9a5e619dd40ec024338e56
MD5 356a7d16faf7f8df2ce78a5ac39df0af
BLAKE2b-256 f89a560751118bf3e4ec4f20134f3621d69409a630eb1ab293a53a878c6130a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page