Log21

Latest version: v2.10.0

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

Scan your dependencies

Page 7 of 12

2.3.4

Added a new method to `log21.Logger` class: `log21.Logger.clear_line`. This method clears the current line in the
console and moves the cursor to the beginning of the line.

2.3.3

Fixed a bug that would cause an error creating a progress bar with no value set for width in systems without support for
os.get_terminal_size().

2.3.2

Added `additional_variables` argument to `log21.ProgressBar` class. You can use it in order to add additional variables
to the progress bar:

python3
import log21, time

progress_bar = log21.ProgressBar(format_='Iteration: {i} {prefix}{bar}{suffix} {percentage}%', style='{',
additional_variables={"i": 0})

for i in range(100):
progress_bar(i + 1, 100, i=i)
time.sleep(0.1)
Iteration: 99 |██████████████████████████████████████████████████████████████████████████████| 100%

2.3.1

Added `formatter` argument to `StreamHandler` and `FileHandler`. You can use it to set the formatter of the handler when
you create it. Added `handlers` argument to `Logger`. You can use it to add handlers to the logger when you create it.

2.3.0

Added progressbar custom formatting.

Now you can use your own formatting for the progressbar instead of the default one.

Let's see an example:

python
We import the ProgressBar class from log21
from log21 import ProgressBar
psutil is a module that can be used to get the current memory usage or cpu usage of your system
If you want to try this example, you need to install psutil: pip install psutil
import psutil
We use the time module to make a delay between the progressbar updates
import time

cpu_bar = ProgressBar(format_='CPU Usage: {prefix}{bar}{suffix} {percentage}%', style='{', new_line_when_complete=False)

while True:
cpu_bar.update(psutil.cpu_percent(), 100)
time.sleep(0.1)

2.2.0

Added CrashReporter!

You can use Reporter classes to monitor your program and send crash reports to the developer. It can help you fix the
bugs and improve your program before your users get upset about it. See some examples in
the [log21/CrashReporter/Reporters.py](https://github.com/MPCodeWriter21/log21/blob/master/log21/CrashReporter/Reporters.py)
file.

Page 7 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.