Skip to main content

Logs the app

Project description

Logging functions for log the application info and errors.

Whenever you do:

# pyinstaller, making executable without console

pyinstaller --windowed --onefile your_app.py

Your app not save/display errors, crashes without any info.

This is for that, log the errors to logs folder.

So user send logs to YOU, and you can fix the issues.

Usage:

Don't forget file_path=file to know which file logged the info or module just log itself

from log import *
file = __file__
log("This is an info message.", file_path=file)
log("This is a warning message.", detail="WARNING", file_path=file)
log("This is an error message.", detail="ERROR", file_path=file)
try:
    hello
except Exception as e:
    log(str(e), detail="error", file_path=file)

# full log info from exception object:
try:
    1 / 0
except Exception as e:
    loged = get_error_log(e)
    log(loged, detail="ERROR", file_path=file)

# or use SimpleLog class for no always file_path parameter:
logger = SimpleLog(file_path=__file__)
logger.info("This is an info message.")
logger.warning("This is a warning message.")
logger.error("This is an error message.")
try:
    hello
except Exception as e:
    logger.detailed_error(str(e))

Licence:

MIT License

Copyright (c) 2025 Erkhemee

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Additional info (may you have to know it)

FAQ:

  • Where is log saved? The log is in folder logs, on same location of file that created. Logs sorted by date.

Creators:

Ericwasepic127 Ericwasepic127's logo

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

log_the_app_ericwasepic127-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

log_the_app_ericwasepic127-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file log_the_app_ericwasepic127-1.0.0.tar.gz.

File metadata

File hashes

Hashes for log_the_app_ericwasepic127-1.0.0.tar.gz
Algorithm Hash digest
SHA256 15dc10d2f9aea10c00829053bf77ca5bb13d7f654fd65afa5aac04c0da4b0ed7
MD5 7d52d08c9293218a9b17d7329c5f0120
BLAKE2b-256 fb809f9a7bf361c4f4f809f193f13ba5e29e9aec148b3fad02e1663e99973364

See more details on using hashes here.

File details

Details for the file log_the_app_ericwasepic127-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for log_the_app_ericwasepic127-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 caec8a46a42e00496c9b39a04f387a60aed73c3d214367a454bb17f0d9849a97
MD5 6d7ca1da036f46688f518e37ccaee6b9
BLAKE2b-256 61408a925852a1f6b62c4b29a6e96984ccff1a0428127807e0494c43e355da96

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