Skip to main content

Powerful functional logger

Project description

template GitHub license CHANGELOG PULL_REQUEST_TEMPLATE

PyPI GitHub release (latest by date) GitHub release (latest by date including pre-releases) GitHub commits since latest release (by date including pre-releases)

PyPI - Python Version PyPI - Wheel PyPI - Format PyPI - Status

GitHub last commit GitHub Release Date GitHub (Pre-)Release Date

GitHub repo size GitHub code size in bytes Lines of code

Mighty Logger

Content

Preamble

I often came across the opinion that it is better to use not standard output to the console, but full-fledged logging... However, the standard libraries do not provide exactly what I need... Therefore, I decided to make my own library! Which will implement the functionality I need.

I was inspired by the colored-logs library.


This library has been renamed to "Mighty logger", but this library used to be called "Qt Colored logger". You can search for old commits in this repository, but you can download the old build from the link.

Overview

The library implements the formation of a beautifully formatted colored text, similar to a log, which has all the necessary information:

  • Device name and registered profile, system name, etc. (this data is displayed only once at the beginning of the logging)
  • Log entry time
  • Log entry status
  • Log entry type
  • Entry message

Any information to the output can be turned off (according to the default, everything is included). It is also possible to change the output settings during the logging process. It is possible to change the colors of the foreground text and the background, icons and animations.

Important releases

See the important releases (possible spoilers)
  • v0.0.1 - Alpha-release (the very first version of the simplest Logger has been published)
  • v0.0.2 - Little update (added multiple entry types and colors)
  • v0.0.3 - Types update (added even more multiple entry types and colors)
  • v0.0.4 - Color update (added the entire X11 color table and reworked the color system)
  • v0.1.0 - First official release (complete basic HTML logger)
  • v0.2.0 - Structural update (added basic console logger with HTML base)
  • v0.3.0 - Background update (added background for log entries)
  • v0.4.0 - Buffer update (added text buffer)
  • v0.5.0 - Unifying update (console and HTML are combined into one class)
  • v0.5.1 - Hints update (added status message templates and hint symbols (icons) near log entries status)
  • v0.6.0 - Progress update (added start of some log entries in threads (process))
  • v0.6.1 - Animation update (added animations in processes)
  • v0.7.0 - "Buffer improvement" update (buffer development completed and entry type system reworked)
  • v0.7.1 - Modding update (buffer modification added - sorting, searching and selecting)
  • v0.8.0 - Export update (added conversion to different types, such as csv, pdf, etc.)
  • v0.9.0 - Extension update (made wheel format and instruction of toml)
  • v0.9.1 - Documenting update (all updates since v0.7.0 are documented; updated old documentation; documentation site generation added)
  • v1.0.0 - Completion of logger development (logger development completed)
  • v1.1.0 - Font update (added a class that formats text outside the logger)

LICENSE

The full text of the license can be found at the following link.

Copyright © 2023 Kalynovsky Valentin. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and

Installation

Despite the fact that the library was originally developed for use in PyQt, it does not require PyQt to be installed, since this framework for outputting to Text fields, which support not only Plain Text, uses HTML and this library simply simplifies the logging process, since the creation process already formatted strings is registered in this library.

To install the library, enter the command:

pip install mighty_logger

Usage

ATTENTION!!! OUTDATED MATERIAL! RELEVANCE - v0.6.1! WILL BE OVERWRITTEN IN v0.9.1!

This is the simplest example of using the library:

from mighty_logger import Logger
from mighty_logger.src import StatusMessagePatterns

if __name__ == "__main__":
	logger = Logger(program_name="Test", console_width=115)
	logger.message(status_message=StatusMessagePatterns.custom("Hooray"), message_text="Hello world!")

The outputs in console will contain the following text (GitHub, PyPi and possibly some other sites do not support displaying colors in Markdown - use resources that support them, such as PyCharm):

-Test?entry> $███████████████^████@███████:██████████:█████:█████████:█████
-?entry>         *2023-06-08 14:01:39.423493 💬 #STATUS: Hooray @MESSAGE - Hello world!

See the APPLYING.md file for more details.

Additional functionality

Additional functionality is also planned. Let's keep it a secret for now. Let it be a surprise.

Data

See the DATA.md file.

Troubleshooting

All functionality of the library has been tested by me, but if you have problems using it, the code does not work, have suggestions for optimization or advice for improving the style of the code and the name - I invite you here and here.

Authors


Kalynovsky Valentin

"Ideological inspirer and Author"

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

mighty_logger-0.7.1.tar.gz (36.0 kB view hashes)

Uploaded Source

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