Skip to main content

log-everywhere Python API

GitHub license GitHub stars GitHub forks
PyPI version
PyPI - Wheel PyPI - Format PyPI - Status
PyPI - Implementation PyPI - Python Version
codebeat badge

Installing the package

Enter the following in your command line:

# if something isn't working properly, try rerunning this
# the problem may have been fixed with a newer version

pip3 install -U log-everywhere     # MacOS/Linux
pip  install -U log-everywhere     # Windows
Using the log-everywhere package
python3     # MacOS/Linux
python      # Windows
from log_everywhere import yield_logger
from log_everywhere import log

def do_important_things(log_locations):
    num = 1 + 1
    log(f'This function calculated num to be: {num}', log_locations)
    product = num * 2
    log(f'This function calculated the product of num multiplied by 2 to be: {product}', log_locations)
    log( 'This function is now closing...', log_locations)

def main():
    with yield_logger('name_of_my_log_file', log_silently=False) as log_locations:
        do_important_things(log_locations)

main()

To see why Python Standard Library's logging module was insufficient and creating a custom logger was necessary, see this modification in the yt_videos_list package. NOTE that the exact implementation differed slighlty in this commit (yield_logger() was named yield_file_writer()), and support for logging to both the console AND the log file wasn't added until this commit

Direct link to commits:

To see more interesting logging modifications, see the significantly improves logging section nested within the details section of the yt_videos_list package 0.5.0 Release page!

Seeing all available functions for the log-everywhere package
python3     # MacOS/Linux
python      # Windows
import log_everywhere
help(log_everywhere.logger)

# OR

from log_everywhere import logger
help(logger)

# SEEING PACKAGE METADATA
import log_everywhere
help(log_everywhere)
Usage Statistics

PyPI - Daily Downloads PyPI - Weekly Downloads PyPI - Monthly Downloads
PePY Weekly Downloads PePY Monthly Downloads PePY Total Downloads

If you found this interesting or useful, please consider starring this repo on GitHub so other people can more easily find and use this. Thanks!

Metadata

Release files for log-everywhere 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for log-everywhere 0.0.1
File Size Uploaded
log_everywhere-0.0.1.tar.gz 9.7 kB Details

Release files / log_everywhere-0.0.1.tar.gz

Download URL log_everywhere-0.0.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4c9bb1c8d14f1ecfe38c50316cf7a784be0d8c64e70657328d98b0b208d7337c
BLAKE2b-256 checksum
How to use checksums
69b5a86c1248682573419ff05a644a884dcf62fa109d87d5d5ce842142b68527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page