Mighty-logger

Latest version: v1.0.0

Safety actively analyzes 624552 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

31.03.2023

Bug Fixes:
- Fixed old calls to `Singleton` and `BasicLogger` to new `_Singleton` and `_BasicLogger` in `HtmlColorSetInitQ`, `LoggerQ`, `AnsiColorSetInit` and `Logger` classes;
- Fixed a bug in the `setColor()` method of the AnsiColorSetInit class, where the value of the new argument was not passed to the `Dec2Ansi()` function after changing the `GetAnsiFormat()` function.

Documenting:
- Wrote the actual README (which takes into account changes in versions v0.2.0 and v0.2.1);
- Fixed a bug in the annotation of the `setColor()` method of the `HtmlColorSetInitQ` class;
- Changed the order of the changelog - now it goes in direct order from top to bottom (easy to read and understand), and not from bottom to top.

Enhancements:
- For `GetAnsiFormat()` implemented the `_RecursiveGetAnsiFormat()` helper function for it - now `GetAnsiFormat()` takes the path to the ANSI escape code value, recursively traverses the tree and returns the ANSI escape code value, which helps to make the code easier to understand and speed up development programs when using the library; here are some examples:
python
Before
print(f"{AnsiFormat['color']['set']['background'].replace('$', '255;165;0')}Test string")
print(f"{AnsiFormat['reset']['on']}Test string")

After
print(f"{GetAnsiFormat('color/set/background/255;255;255')}Test string")
print(f"{GetAnsiFormat('reset/on')}Test string")

- If earlier the `AnsiColor()` returned only the color of the text (the usual foreground), now you can specify any of the five plans (this is necessary for the next update, where I will add a change not only to the color, but also to the background of the logs):
1. foreground
2. background
3. bright foreground
4. bright background
5. underline
- Adapted the `Dec2Ansi()` and `Hex2Ansi()` functions to the modified `AnsiColor()`;
- The structure of the `qt_colored_logger/_basic` protected directory has been slightly changed.

Security:
- Protected the `qt_colored_logger/basic` directory - now it is called `qt_colored_logger/_basic`: you can still use its functionality, but now, according to the agreement, the IDE will issue a warning; *remember - protected modules are designed only for use inside the library*.

Refactoring:
- `GetAnsi()` -> `GetAnsiFormat()`;
- `AnsiForegroundColor()` -> `AnsiColor()`;
- Changed names of keys in `AnsiFormat/font` dictionary from "1th alternative", "2th alternative" and "3th alternative" to "1st alternative", "2nd alternative" and "3rd alternative" respectively.

---

30.06.2023

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.

---

29.06.2023

*On PyPi, it was tested and removed.*

Enhancements:
- Moved from `setup.py` to `pyproject.toml`;
- Began to collect `wheel`.

---

29.03.2023

Documentation:
- Documented all new functionality;
- Fixed typos and outdated information in old documentation.

Enhancements:
- Added a large dictionary of all ANSI escape codes and the `GetAnsi()` function to get it;
- Fully implemented `AnsiColorSetInit` and `Logger` classes based on `HtmlColorSetInitQ` and `LoggerQ`;
- `Singleton` pattern used by `HtmlColorSetInitQ`, `LoggerQ`, `AnsiColorSetInit` and `Logger` moved to a separate class;
- A base class has been created for `LoggerQ` and `Logger`, which includes initialization, setting up loggers and generating entry strings (*at the moment, inherited classes are used to simplify interaction with the base class and use ready-made functionality, but in the future their own functionality will be expanded*);
- **The project structure has been completely changed** (*however, this only affects the development of the library and support for programs written with the version of the library v0.1.0 will remain, since the external attributes of communication with the library have not changed*);
- Added the `DefaultColorScheme` list, which stores a list of all colors that are used in the color schemes of the loggers and the `GetDefaultColorScheme()` function to get this list;
- Now the `ColorPicker` dictionary stores only color values in RGB, and other formats are obtained by converting RGB;
- Added functions `Dec2Hex()`, `Dec2Ansi()`, `Hex2Dec()`, `Hex2Ansi()`, `Ansi2Dec()`, `Ansi2Hex()`, which are used to convert one color value format to another;
- *The logic of assembling strings logging entry's has been completely changed*;
- The work of the `HtmlColorSetInitQ` and `LoggerQ` classes is adjusted to the new best functionality that is used in the new classes `AnsiColorSetInit` and `Logger`.

Performance:
- Optimized `HexColor()` and `AnsiForegroundColor()` functions.

Refactoring:
- `CodColor()` -> `AnsiForegroundColor()`.

---

28.06.2023

Enhancements:
- Added a new property to `EntryType` - `type_category`;
- Added a new list of entry categories `SelectionCategories` for the `Modifier.select()` method;
- Now, depending on which list element is passed to `Modifier.select()` (`SelectionTypes` or `SelectionCategories`), this method will select entries either by types or by categories.

Refactoring:
- The `powerful_logger` module has been renamed to `mighty_logger`.

---

26.06.2023

Enhancements:
- All entry types were merged into one `entry()` method, and all type differences were moved to the `LoggerEntryTypes` (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;
- 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;
- Added `EnvironmentException` and `InitException`;
- 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 the `CONSOLE` environment and the new `PLAIN_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 the `clean` argument is important for any environment, since the Buffer of Logger can store not only log entries, which allows the `empty()` method, which is a standard `print()` in the library);
- The implementation of the `remove()` method in the buffer is complete;
- Added `clear()` and `load()` methods;
- `TextBufferType` is no longer an abstract class like other types-class;
- Buffer development completed;
- 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()`[^strange] - `TextBufferType.insert()`;
- `Logger.modify()`[^strange] - `TextBufferType.replace()`;
- `Logger.catchy()`[^strange] - `TextBufferType.pop()`;
- `Logger.extractly()`[^strange] - `TextBufferType.remove()`;
- `Logger.clearly()`[^strange] - `TextBufferType.clear()`;
- `Logger.savy()`[^strange] - `TextBufferType.save()`;
- `Logger.loady()`[^strange] - `TextBufferType.load()`;
- `Logger.getty()`[^strange] - `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()`.


[^strange]: 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 regular `print()` 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.

Deprecated:
- 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);
- Removed emptied package `text`;
- Removed `CombinationException`.

Performance:
- Optimized buffer initialization.

---

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.