Releases: Nakama3942/mighty_logger
Completion of logger development
Documenting:
- Fixed all errors in the documentation;
- Added animations to examples;
- Documented new functionality and changes;
- Added TODO list.
Enhancements:
- Added a new method for outputting the added string to the Buffer;
- Transferred percentages - now they are displayed not after the animation, but after the message of the entry (at the end of the string);
- Added a new entry type category:
AdditionalEntryTypes
:hint
;tip
;important
;attention
;caution
;danger
.
Deprecated:
- Removing the initialization string is marked as deprecated method, but available for use.
Performance:
- Adding an entry has been optimized - now after adding an entry to the Logger Buffer, instead of updating the entire output to the console, a new method is used that outputs a new string to the console, however, all other wrapper methods of the Logger over the Buffer continue to update the entire output;
- Optimized Modifier and Exporter.
Web docs update
Bug Fixes:
- Fixed a bug in the line builder in the PLAIN environment when processing the addition of the
#STATUS:
line - it was simply forgotten to remove the check for the removed condition.
Documentation:
- Moved the documentation from the code to the Web docs (now there is no documentation in the code, except for the
simple_logger
module); - README, APPLYING and DATA have been rewritten in INDEX, HOW TO USE and DATA;
- Added EXAMPLE and LICENSE;
- Rewrote the entire CHANGELOG to the new standard;
- Completed Web docs.
Enhancements:
- Added
text_buffer
property toTextBufferType
; - Added
settings
andbuffer
properties toMightyLogger
; - Replaced the
might()
method with themight
property inLogger
; - Moved modules from
lib_types_collection
package tosrc
; - Arguments
program_name
andlog_environment
inMightyLogger
are now required; - Added redefinition of new operators in Text Buffers:
<
and>
; - Changed the behavior of old operators:
<
adds a string to the end of the file;>
extracts a string at the given number;<<
loads the Buffer from a file;>>
saves the Buffer to a file.
Deprecated:
- Removed package
lib_types_collection
.
Security:
MightyLogger
,BasicTextBuffer
andTextBuffer
are now available outside the library again.
Performance:
- Part of the checks in the Text Buffer moved from save/load methods to the constructor to immediately detect a mismatch between the type of environment and the type of Buffer, which leads to optimization of saving/loading and eliminating unexpected behavior when it is possible to use the Buffer with the wrong environment.
Feature update
Documenting:
- Updated documentation.
Enhancements:
- Made the
background
field a global setting; - Added the ability to change global settings and read them while the Logger is running;
- Added settings arguments to the "simple" Logger constructor;
- Hid the "mighty" Logger, but it can be used via the
might()
method; - Prohibited the creation of more than one "simple" Logger object, but "simple" and "mighty" Loggers can coexist, since "simple" uses "mighty" and is not inherited.
Documenting update
Documenting:
- Updated documentation.
Extension update
Enhancements:
- Moved from
setup.py
topyproject.toml
; - Began to collect
wheel
;
Export update
Enhancements:
- Any references and functionality about status messages are completely cut out from the entire library:
- Removed module
status_message_type
with nested type (class)StatusMessageType
; - Removed module
status_variables
with nested list ofStatusMessagePatterns
; - Arguments that accept a status message have been removed from all methods;
- In the entry builder (
BasicLogger._assemble_entry()
), the addition of a status message to the entry has been removed;
- Removed module
- Added new
Exporter
class with two methods:export_to_csv()
, which creates a list of dictionaries from a list of strings;save()
, which saves the list of dictionaries as a csv table;
- Added
export_to_csv()
method to Logger, which automates work with Exporter; - Since both Exporter and Modifier divide the string according to certain patterns, I had to prohibit disabling any parts of the entry, otherwise the functionality of these classes becomes inoperative - it was originally designed for the full string (except the status message, which the author never used and decided to delete, as a rudimentary organ, because on the very first prototype, when the Logger was part of another project, it was the entry type that acted for the status message and no one knows why a separate status message was added...);
- Added a new argument to
sort_with_save()
,search_with_save()
,select_with_save()
andexport_to_csv()
, through which you can set the name of the file where you want to save the modified/exported logs; - Moved the
text_buffer
module from the src package to the basic package and hid it from__init__
, since now there is no need to keep the Buffer object separately due to the presence of new methods in the Logger itself, which provide access to all Buffer methods and, partially, simplify and automate the work with the Buffer; - Renamed the
patterns
module tosingleton
and hidden from__init__
, since its use is supposed only inside the library by some classes; - Added a new MessageException thrown by the entry builder (
BasicLogger._assemble_entry()
) if the message length is less than 10 characters; - Now it is necessary to enter a message (longer than 10 characters), but it is not necessary to enter the name of the arguments;
- The system of importing standard library packages has been optimized, which will ease the load on RAM when the Logger is running.
Categories update
Enhancements:
- Added a new property to
EntryType
-type_category
; - Added a new list of entry categories
SelectionCategories
for theModifier.select()
method; - Now, depending on which list element is passed to
Modifier.select()
(SelectionTypes
orSelectionCategories
), this method will select entries either by types or by categories; - The
powerful_logger
module has been renamed tomighty_logger
.
Modding update
Enhancements:
- Renamed
Logger
toMightyLogger
; - Renamed
SimpleLogger
toLogger
; - Renamed
Logger.get_logger()
toLogger.might()
; - Removed methods:
Logger.print()
;Logger.input()
;Logger.save()
;Logger.load()
;Logger.separator()
;
- Added a new
Modifier
class with:- the
sort()
method for sorting logs by key; - the
search()
method to search for logs that contain a given string in the message; - the
select()
method for selecting logs by type; - the
entries
property, which returns a list;
- the
- Added a new type
SortingKeyType
; - Added a new list of keys
SortingKeys
for theModifier.sort()
method; - Added a new list of entry types
SelectionTypes
for theModifier.select()
method; - Reworked the signature of the
BasicLogger._assemble_entry()
method; - Added methods to
MightyLogger
that make it easier and more automated to work with the newModifier
class:sort()
;sort_with_save()
;search()
;search_with_save()
;select()
;select_with_save()
;
- Created a new package src.lib_types_collection and filled with modules entry_types, environments, sorting_keys, status_variables;
- Renamed
animation
module toanimations
.
"Buffer improvement" update
Enhancements:
- All entry types were merged into one
entry()
method, and all type differences were moved to theLoggerEntryTypes
(available),ProcessEntryTypes
(available),ServiceProcessEntryTypes
(not available),ServiceTimerEntryTypes
(not available) classes; - Due to the acquired complexity, a simplified version of the Logger was written - SimpleLogger, where all the cut Logger methods, such as
debug
,message
, etc., were transferred; - Removed the ability to create custom icon sets (and removed the icon set module);
- The ability to change the color of entries has been removed (now it is impossible to change the color scheme at all due to the new improved data storage system for entry types);
- Added new type
EnvironmentType
; - Added new Logger environments:
PLAIN_CONSOLE
;MARKDOWN
;PLAIN
;
- All types (classes) created for use within the library have been redefined from their original modules into the new
basic.lib_types
package; - Animations and Text buffers module moved to
src
package; - Removed emptied package
text
; - Removed
CombinationException
; - Added
EnvironmentException
andInitException
; - Buffer updated:
- Added Buffer input implementation (because after creating a Logger object, you can't use the standard Python
print()
,input()
and other functions that can affect console output when using theCONSOLE
environment and the newPLAIN_CONSOLE
) - now there is not only output in console, but also input (input()
method in Buffer); - Updated the
save()
method of the Text buffer (now theclean
argument is important for any environment, since the Buffer of Logger can store not only log entries, which allows theempty()
method, which is a standardprint()
in the library); - The implementation of the
remove()
method in the buffer is complete; - Added
clear()
andload()
methods; TextBufferType
is no longer an abstract class like other types-class;- Buffer development completed;
- Added Buffer input implementation (because after creating a Logger object, you can't use the standard Python
- Added methods-publishers in the Logger, which display certain information about the Logger in the logs:
publish_id()
publishes the generated Logger ID;publish_program_name()
publishes the name of the program whose work is being logged;publish_environment()
publishes the environment in which the Logger works;publish_global_settings()
publishes global Logger settings;publish_author()
publishes the author of the library;publish_license()
publishes a library license;separator()
adds a separator in the form of a line of eighty dashes;
- Added wrapper methods in Logger for Buffer methods:
Logger.addy()
1 -TextBufferType.insert()
;Logger.modify()
1 -TextBufferType.replace()
;Logger.catchy()
1 -TextBufferType.pop()
;Logger.extractly()
1 -TextBufferType.remove()
;Logger.clearly()
1 -TextBufferType.clear()
;Logger.savy()
1 -TextBufferType.save()
;Logger.loady()
1 -TextBufferType.load()
;Logger.getty()
1 -TextBufferType.input()
;
- Of the new wrapper and publisher methods, SimpleLogger implements:
SimpleLogger.print()
-Logger.empty()
;SimpleLogger.input()
-Logger.getty()
;SimpleLogger.save()
-Logger.savy()
;SimpleLogger.load()
-Logger.loady()
;SimpleLogger.separator()
-Logger.separator()
;
- Optimized buffer initialization.
-
Why such strange names were chosen is a big story here ... Initially, each entry type represented a different method, but in the documentation, the entry was always represented by the word "entry". When the author had to add the
Logger.note_process()
method, there was a need to add lines without forming them (that is, to do a regularprint()
in the Logger, since there was already a functional in the buffer). Since it was thought that such strings would be called "empty", they began to be called "empty". Having already two methods ending in "y", other names were invented for all other Buffer wrapper methods with the main condition - the last letter "y". This was done just for fun. The native language of the author is Ukrainian. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
Animation update
Bug Fixes:
- Fixed a bug where the percentage was changing just before adding a Process entry, and it was completely breaking the output (and a 0.01 second delay was enough to fix it);
- Fixed a bug that occurs when the last string in the console is removed, which occupies more than 1 line.
Documenting:
- Updated versioning;
- Updated documentation.
Enhancements:
- Added new animations and worked out the old ones;
- Added a new category of types: Timer, and 3 entries for it.