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

upload

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

Use

install

pip install ykenan_log

use

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

import ykenan_log

logger = ykenan_log.Logger("name", "log")

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

output

run...
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 = "DEBUG",

is_solitary: bool = True,

is_form_file: bool = True,

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 DEBUG.
: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 True.
: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.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ykenan_log-0.2.0.tar.gz
Algorithm Hash digest
SHA256 268e7b909c9cde119a0a1c5bc1ed02dc621cd144da167c44371ca34d42ed7208
MD5 167ae6307be5394a665fc02000b9ea71
BLAKE2b-256 217ce75aae939099260116c99b4374fdf2a0c4528ffcf6f52ab8ea0c6440916b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ykenan_log-0.2.0-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.9.9

File hashes

Hashes for ykenan_log-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e37aae644e4c42aed4f8cafd302359505050e04f16ee24469ddd808481867361
MD5 bb7f508d439b6786fedd82163f213b77
BLAKE2b-256 d130e74416fe9336fca327f3ac6dd095d613d401f8bfaef9afca1376d13a0af6

See more details on using hashes here.

Supported by

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