Skip to main content

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

Project description

yzm_log

Print and save a simple log to a file

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

upload

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

Use

install

pip install yzm_log

use

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

from yzm_log import Logger

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

if __name__ == '__main__':
    print("run...")
    log.debug("info......")
    log.info("info......")
    log.warning("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

yzm_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

yzm_log-0.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

yzm_log-0.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file yzm_log-0.0.1.tar.gz.

File metadata

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

File hashes

Hashes for yzm_log-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a078ec241a9ea315720ff53eec363944a6d0393145e77085700da99ebb3ac492
MD5 1c6fd7b52ae16b858b06b80d93c9c020
BLAKE2b-256 63216aff93b8e05dc27b80346c0042a6e315d941cfa04ad479836e13716d9ea5

See more details on using hashes here.

File details

Details for the file yzm_log-0.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for yzm_log-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea23094d030b38bc3f2155d7e3b176d340715ce5f8bbc58397b0a5d46049de1e
MD5 863837c4162f3011eb8042ea64518510
BLAKE2b-256 b61d6d0ced9c79e784d27f8538d1194cb06921571713ad43980eb1640aad18bd

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