Skip to main content

Just some simple logging functions that can be used in pretty much any program.

Project description

Simple Logging

Just some simple logging functions that can be used in pretty much any program.

Installation

This program was developed and tested in python 3.10 and uses standard libraries. Although many earlier versions will work, I just haven't bothered testing them.

You can install this library with the following command

pip install Simple-Logger-Tool -U

Usage

Import the logger class into your python file with the code below.

from Simple_Logger_Tool.Simple_Logger_Tool import Logger

You can create a logger object by using the code below. Where I have put test logger, you can put whatever you want the logger to be called on your system.

One suggested usage would be today's date. This name is used to name the file it stores the logs to. This means that if you provide an already used name then it will append to that log file.

lgr = Logger("Test_Logger")

This code is an example of logging something for information

lgr.log_info("This is a test of the logging info")

This code is an example of logging something for warnings

lgr.log_warning("This is a test of the logging warning")

This code is an example of logging something for errors

lgr.log_error("This is a test of the logging error")

An example output of the code above in the log (txt) file is:

###############################################################
[19/04/2022 at 16:29:11]
[LOGGER INITIALIZED]
###############################################################
[19/04/2022 at 16:29:11 | INFO   ]: This is a test of the logging info
[19/04/2022 at 16:29:11 | WARNING]: This is a test of the logging warning
[19/04/2022 at 16:29:11 | ERROR  ]: This is a test of the logging error

License

MIT License

Copyright (c) 2022 Matt

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.

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

Simple_Logger_Tool-1.0.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

Simple_Logger_Tool-1.0.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file Simple_Logger_Tool-1.0.5.tar.gz.

File metadata

  • Download URL: Simple_Logger_Tool-1.0.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for Simple_Logger_Tool-1.0.5.tar.gz
Algorithm Hash digest
SHA256 cf91cb9fea301ea963497ea20d7ee113bc1564673d2f5159c752669249583575
MD5 f02dd6be82f72e6a935e6a02689dde10
BLAKE2b-256 193f7c20fe7c6b93f063566d56f36e5d2157338a3434a3f837374e4177f032df

See more details on using hashes here.

File details

Details for the file Simple_Logger_Tool-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for Simple_Logger_Tool-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4637f129bce63031881c1dee7a8b7b7016bb1899251c3822dccfc7f26ffdd156
MD5 5103e7e09bf3ddcbee58c49b13f1d354
BLAKE2b-256 6eb560e3d8af43f017832613b42c6de0b25d11689f37a6f4fb7fa43e3b7e1a33

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