Skip to main content

Log information: Print the log, export the log file.

Project description

ykenan_log

Print and save a simple log to a file

This is a simple log package. You can see Github-ykenan_log PyPI-ykenan_log

upload

py -m build
twine check dist/*
twine upload dist/*

Use

install

pip install ykenan_log

use

# -*- coding: utf-8 -*-

from ykenan_log import Logger

log = Logger("name", "log")

if __name__ == '__main__':
    print("run...")
    log.debug("info......")
    log.info("info......")
    log.warn("info......")
    log.error("info......")

output

2023-03-17 09:21:36 root name[34768] DEBUG info......
2023-03-17 09:21:36 root name[34768] INFO info......
2023-03-17 09:21:36 root name[34768] WARNING info......
2023-03-17 09:21:36 root name[34768] ERROR info......

Introduction

main function

ykenan_log.Logger(

name: str = None,

log_path: str = None,

level: str = "INFO",

is_solitary: bool = True,

is_form_file: bool = False,

size: int = 104857600,

backup_count: int = 10,

encoding: str = "UTF-8"

)

:param name: Project Name
:param log_path: Log file output path. Default is log_%Y%m%d.log.
:param level: Log printing level. Default is INFO.
:param is_solitary: When the file path is consistent (here, the log_path parameter is not a specific file name, but a file path), whether the file is formed independently according to the name parameter. Default is True.
:param is_form_file: Whether to form a log file. Default is False.
:param size: Setting the file size if a file is formed. Default is 104857600. (100MB)
:param backup_count: Setting the number of rotating files if a file is formed. Default is 10.
:param encoding: Setting of file encoding if a file is formed. Default is UTF-8.

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

ykenan_log-0.2.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ykenan_log-0.2.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ykenan_log-0.2.4.tar.gz.

File metadata

  • Download URL: ykenan_log-0.2.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for ykenan_log-0.2.4.tar.gz
Algorithm Hash digest
SHA256 792535d796e567aaff249d0f2791264f236b59ad0c109ee6d8bb9db492dff03d
MD5 f6462fb91b59a0a2ef5bf44d427fe0af
BLAKE2b-256 889ba0f3616be7d9b32edde64ee1b653d308fcb9b5dde627ecc39c6404c3d705

See more details on using hashes here.

File details

Details for the file ykenan_log-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: ykenan_log-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for ykenan_log-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 972ce1f6792860e239516331b26fabfc4cd0c385bdbf8aed9407af7f2788ff17
MD5 a17a3439c787604a2554f0ad7dee1fff
BLAKE2b-256 e033d241785ed1366f7f0593f4b1405ff4e34d2d5a16eea1f1fc2d5d2a1ac338

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