Skip to content

Commit d79fa24

Browse files
Merge pull request #75 from MEHRSHAD-MIRSHEKARY/refactor/docs
⚑ πŸ“š πŸ”¨ refactor(docs): Update readme & rst files
2 parents 23637e7 + dfcc9e0 commit d79fa24

File tree

7 files changed

+58
-53
lines changed

7 files changed

+58
-53
lines changed

β€ŽREADME.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
The [`django_logging`](https://github.com/ARYAN-NIKNEZHAD/django_logging) is a Django package designed to extend and enhance Python’s built-in logging capabilities. By providing customizable configurations and advanced features, it offers developers a comprehensive logging solution tailored specifically for Django applications.
44

55
![License](https://img.shields.io/github/license/ARYAN-NIKNEZHAD/django_logging)
6-
![PyPI release](https://img.shields.io/pypi/v/django_logging)
7-
![Supported Python versions](https://img.shields.io/pypi/pyversions/django_logging)
8-
![Supported Django versions](https://img.shields.io/pypi/djversions/django_logging)
9-
![Documentation](https://img.shields.io/readthedocs/django_logging)
6+
![PyPI release](https://img.shields.io/pypi/v/dj-logging)
7+
![Supported Python versions](https://img.shields.io/pypi/pyversions/dj-logging)
8+
![Supported Django versions](https://img.shields.io/pypi/djversions/dj-logging)
9+
![Documentation](https://img.shields.io/readthedocs/django-logging)
1010
![Last Commit](https://img.shields.io/github/last-commit/ARYAN-NIKNEZHAD/django_logging)
1111
![Languages](https://img.shields.io/github/languages/top/ARYAN-NIKNEZHAD/django_logging)
1212
![CI Workflow](https://github.com/ARYAN-NIKNEZHAD/django_logging/actions/workflows/ci.yml/badge.svg)
@@ -40,7 +40,7 @@ Getting started with `django_logging` is simple. Follow these steps to get up an
4040
first, Install `django_logging` via pip:
4141

4242
```shell
43-
$ pip install django_logging
43+
$ pip install dj-logging
4444
```
4545

4646
2. **Add to Installed Apps**

β€Ždocs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Contributing to django_logging
1+
Contributing
22
==============================
33

44
We’re excited that you’re interested in contributing to `django_logging`! Whether you’re fixing a bug, adding a feature, or improving the project, your help is appreciated.

β€Ždocs/index.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ Welcome to django_logging Documentation!
99
:target: https://github.com/ARYAN-NIKNEZHAD/django_logging/blob/main/LICENSE
1010
:alt: License
1111

12-
.. image:: https://img.shields.io/pypi/v/django_logging
13-
:target: https://pypi.org/project/django_logging/
12+
.. image:: https://img.shields.io/pypi/v/dj-logging
13+
:target: https://pypi.org/project/dj-logging/
1414
:alt: PyPI release
1515

16-
.. image:: https://img.shields.io/pypi/pyversions/django_logging
17-
:target: https://pypi.org/project/django_logging/
16+
.. image:: https://img.shields.io/pypi/pyversions/dj-logging
17+
:target: https://pypi.org/project/dj-logging/
1818
:alt: Supported Python versions
1919

20-
.. image:: https://img.shields.io/pypi/djversions/django_logging
21-
:target: https://pypi.org/project/django_logging/
20+
.. image:: https://img.shields.io/pypi/djversions/dj-logging
21+
:target: https://pypi.org/project/dj-logging/
2222
:alt: Supported Django versions
2323

24-
.. image:: https://img.shields.io/readthedocs/django_logging
25-
:target: https://django_logging.readthedocs.io/en/latest/
24+
.. image:: https://img.shields.io/readthedocs/django-logging
25+
:target: https://django-logging.readthedocs.io/en/latest/
2626
:alt: Documentation
2727

2828
.. image:: https://img.shields.io/github/last-commit/ARYAN-NIKNEZHAD/django_logging
@@ -37,7 +37,7 @@ Welcome to django_logging Documentation!
3737
:target: https://github.com/ARYAN-NIKNEZHAD/django_logging/issues
3838
:alt: Open Issues
3939

40-
.. image:: https://codecov.io/gh/ARYAN-NIKNEZHAD/django_logging/branch/main/graph/badge.svg
40+
.. image:: https://img.shields.io/codecov/c/github/ARYAN-NIKNEZHAD/django_logging/main
4141
:target: https://codecov.io/gh/ARYAN-NIKNEZHAD/django_logging
4242
:alt: Coverage
4343

β€Ždocs/quick_start.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Getting Started with `django_logging` is simple. Follow these steps to get up an
99

1010
.. code-block:: shell
1111
12-
$ pip install django_logging
12+
$ pip install dj-logging
1313
1414
2. **Add to Installed Apps**
1515

β€Ždocs/settings.rst

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,36 @@ Settings
33

44
By default, `django_logging` uses a built-in configuration that requires no additional setup. However, you can customize the logging settings by adding the `DJANGO_LOGGING` dictionary configuration to your Django `settings` file.
55

6-
Example configuration:
7-
8-
.. code-block:: python
9-
10-
DJANGO_LOGGING = {
11-
"AUTO_INITIALIZATION_ENABLE": True,
12-
"INITIALIZATION_MESSAGE_ENABLE": True,
13-
"LOG_FILE_LEVELS": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
14-
"LOG_DIR": "logs",
15-
"LOG_FILE_FORMATS": {
16-
"DEBUG": 1,
17-
"INFO": 1,
18-
"WARNING": 1,
19-
"ERROR": 1,
20-
"CRITICAL": 1,
21-
},
22-
"LOG_CONSOLE_LEVEL": "DEBUG",
23-
"LOG_CONSOLE_FORMAT": 1,
24-
"LOG_CONSOLE_COLORIZE": True,
25-
"LOG_DATE_FORMAT": "%Y-%m-%d %H:%M:%S",
26-
"LOG_EMAIL_NOTIFIER": {
27-
"ENABLE": False,
28-
"NOTIFY_ERROR": False,
29-
"NOTIFY_CRITICAL": False,
30-
"LOG_FORMAT": 1,
31-
"USE_TEMPLATE": True,
32-
},
33-
}
6+
Example configuration
7+
---------------------
8+
here is an example of DJANGO_LOGGING in project settings:
9+
10+
.. code-block:: python
11+
12+
DJANGO_LOGGING = {
13+
"AUTO_INITIALIZATION_ENABLE": True,
14+
"INITIALIZATION_MESSAGE_ENABLE": True,
15+
"LOG_FILE_LEVELS": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
16+
"LOG_DIR": "logs",
17+
"LOG_FILE_FORMATS": {
18+
"DEBUG": 1,
19+
"INFO": 1,
20+
"WARNING": 1,
21+
"ERROR": 1,
22+
"CRITICAL": 1,
23+
},
24+
"LOG_CONSOLE_LEVEL": "DEBUG",
25+
"LOG_CONSOLE_FORMAT": 1,
26+
"LOG_CONSOLE_COLORIZE": True,
27+
"LOG_DATE_FORMAT": "%Y-%m-%d %H:%M:%S",
28+
"LOG_EMAIL_NOTIFIER": {
29+
"ENABLE": False,
30+
"NOTIFY_ERROR": False,
31+
"NOTIFY_CRITICAL": False,
32+
"LOG_FORMAT": 1,
33+
"USE_TEMPLATE": True,
34+
},
35+
}
3436
3537
3638
Here's a breakdown of the available configuration options:
@@ -69,7 +71,7 @@ Here's a breakdown of the available configuration options:
6971

7072

7173
Available Format Options
72-
=========================
74+
------------------------
7375

7476
The `django_logging` package provides predefined log format options that you can use in configuration. These options can be applied to log formats. Below are the available format options:
7577

β€Ždocs/usage.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Usage
33

44
Once `django_logging` is installed and added to your `INSTALLED_APPS`, you can start using it right away. The package provides several features to customize and enhance logging in your Django project. Below is a guide on how to use the various features provided by `django_logging`.
55

6-
1. **Basic Logging Usage**
6+
Basic Logging Usage
7+
-------------------
78

89
At its core, `django_logging` is built on top of Python’s built-in logging module. This means you can use the standard logging module to log messages across your Django project. Here’s a basic example of logging usage:
910

@@ -21,7 +22,8 @@ Once `django_logging` is installed and added to your `INSTALLED_APPS`, you can s
2122
2223
These logs will be handled according to the configurations set up by `django_logging`, using either the default settings or any custom settings you've provided.
2324

24-
2. **Request Logging Middleware**
25+
Request Logging Middleware
26+
--------------------------
2527

2628
To capture and log information of each request to the server, such as the request path, user, IP address, and user agent, add `django_logging.middleware.RequestLogMiddleware` to your `MIDDLEWARE` setting:
2729

@@ -40,8 +42,8 @@ Once `django_logging` is installed and added to your `INSTALLED_APPS`, you can s
4042
INFO | 'datetime' | django_logging | Request Info: (request_path: /example-path, user: example_user,
4143
IP: 192.168.1.1, user_agent: Mozilla/5.0)
4244
43-
3. **Context Manager**
44-
45+
Context Manager
46+
---------------
4547
You can use the `config_setup` context manager to temporarily apply `django_logging` configurations within a specific block of code.
4648

4749
Example usage:
@@ -69,7 +71,8 @@ Once `django_logging` is installed and added to your `INSTALLED_APPS`, you can s
6971
7072
"You must set 'AUTO_INITIALIZATION_ENABLE' to False in DJANGO_LOGGING in your settings to use the context manager."
7173
72-
4. **Log and Notify Utility**
74+
Log and Notify Utility
75+
----------------------
7376

7477
To send specific logs as email, use the `log_and_notify_admin` function. Ensure that the `ENABLE` option in `LOG_EMAIL_NOTIFIER` is sent to `True` in your settings:
7578

@@ -106,7 +109,8 @@ Once `django_logging` is installed and added to your `INSTALLED_APPS`, you can s
106109
Additionally, ensure that all required email settings are configured in your Django settings file.
107110
- **Note**: For more detailed configuration options, refer to the [Settings](settings.rst) section.
108111

109-
5. **Send Logs Command**
112+
Send Logs Command
113+
-----------------
110114

111115
To send the entire log directory to a specified email address, use the `send_logs` management command:
112116

β€Žpyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ authors = [ "ARYAN-NIKNEZHAD <[email protected]>", "MEHRSHAD-MIRSHEKARY <meh
1010
license = "MIT"
1111
readme = "README.md"
1212
keywords = [ "django_logging", "django", "logging" ]
13-
repository = "https://github.com/ARYAN-NIKNEZHAD/django_logging"
1413

1514
classifiers = [
1615
"Development Status :: 3 - Alpha",
@@ -38,7 +37,7 @@ packages = [
3837
]
3938

4039
[tool.poetry.urls]
41-
"Documentation" = "https://django_logging.readthedocs.io"
40+
"Documentation" = "https://django-logging.readthedocs.io"
4241
"Source Code" = "https://github.com/ARYAN-NIKNEZHAD/django_logging"
4342
"Issues" = "https://github.com/ARYAN-NIKNEZHAD/django_logging/issues"
4443

0 commit comments

Comments
Β (0)