Skip to content

Commit

Permalink
v3.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ddc committed Dec 31, 2024
1 parent 4b8e869 commit 66f0c8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Easy logs with rotations
# Simple python logs with file rotation

[![Donate](https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic)](https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ)
[![License](https://img.shields.io/pypi/l/pythonLogs)](https://github.com/ddc/pythonLogs/blob/main/LICENSE)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPi](https://img.shields.io/pypi/v/pythonLogs.svg)](https://pypi.python.org/pypi/pythonLogs)
[![PyPI Downloads](https://static.pepy.tech/badge/pythonLogs)](https://pepy.tech/projects/pythonLogs)
[![codecov](https://codecov.io/gh/ddc/pythonLogs/graph/badge.svg?token=QsjwsmYzgD)](https://codecov.io/gh/ddc/pythonLogs)
Expand All @@ -11,10 +11,10 @@



# Logs
+ Parameters for all classes are declared as OPTIONAL
# Notes
+ Arguments for all classes are declared as OPTIONAL
+ arguments takes priority over environment variables
+ If any [.env](./pythonLogs/.env.example) variable is omitted, it falls back to default values here: [settings.py](pythonLogs/settings.py)
+ Function arguments will overwrite any env variable
+ Timezone parameter can also accept `localtime`, default to `UTC`
+ This parameter is only to display the timezone datetime inside the log file
+ For timed rotation, only UTC and localtime are supported, meaning it will rotate at UTC or localtime
Expand All @@ -34,7 +34,7 @@ pip install pythonLogs

# BasicLog
+ Setup Logging
+ This is just a basic log, it does not use any file
+ This is just a basic log, it does not use any file
```python
from pythonLogs import BasicLog
logger = BasicLog(
Expand All @@ -54,9 +54,9 @@ logger.warning("This is a warning example")

# SizeRotatingLog
+ Setup Logging
+ Logs will rotate based on the file size using the `maxmbytes` variable
+ Rotated logs will have a sequence number starting from 1: `app.log_1.gz, app.log_2.gz`
+ Logs will be deleted based on the `daystokeep` variable, defaults to 30
+ Logs will rotate based on the file size using the `maxmbytes` variable
+ Rotated logs will have a sequence number starting from 1: `app.log_1.gz, app.log_2.gz`
+ Logs will be deleted based on the `daystokeep` variable, defaults to 30
```python
from pythonLogs import SizeRotatingLog
logger = SizeRotatingLog(
Expand All @@ -81,12 +81,12 @@ logger.warning("This is a warning example")

# TimedRotatingLog
+ Setup Logging
+ Logs will rotate based on `when` variable to a `.gz` file, defaults to `midnight`
+ Rotated log will have the sufix variable on its name: `app_20240816.log.gz`
+ Logs will be deleted based on the `daystokeep` variable, defaults to 30
+ Current 'when' events supported:
+ midnight — roll over at midnight
+ W{0-6} - roll over on a certain day; 0 - Monday
+ Logs will rotate based on `when` variable to a `.gz` file, defaults to `midnight`
+ Rotated log will have the sufix variable on its name: `app_20240816.log.gz`
+ Logs will be deleted based on the `daystokeep` variable, defaults to 30
+ Current 'when' events supported:
+ midnight — roll over at midnight
+ W{0-6} - roll over on a certain day; 0 - Monday
```python
from pythonLogs import TimedRotatingLog
logger = TimedRotatingLog(
Expand Down Expand Up @@ -144,7 +144,7 @@ poetry build -f wheel
# Run Tests and Get Coverage Report using Poe
```shell
poetry update --with test
poe tests
poe test
```


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pythonLogs"
version = "3.0.12"
description = "Easy logs with rotations"
version = "3.0.13"
description = "Simple python logs with file rotation"
license = "MIT"
readme = "README.md"
authors = ["Daniel Costa <danieldcsta@gmail.com>"]
Expand Down

0 comments on commit 66f0c8a

Please sign in to comment.