Skip to content

Commit a87b852

Browse files
committed
Add log_format to the logging util to allow for standardised logging
1 parent 1309de6 commit a87b852

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Changelog
55
=========
66

77

8+
- :release:`10.3.0 <19th September 2023>`
9+
- :feature:`195` Add `log_format` to `pydis_core.utils.logging` to allow for standardised logging across all services using pydis_core.
10+
11+
812
- :release:`10.2.0 <28th August 2023>`
913
- :support:`192` Bump Discord.py to :literal-url:`2.3.2 <https://github.com/Rapptz/discord.py/releases/tag/v2.3.2>`.
1014

pydis_core/utils/logging.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
LoggerClass = logging.getLoggerClass()
1010

1111
TRACE_LEVEL = 5
12+
log_format = logging.Formatter("%(asctime)s | %(levelname)s | %(name)s | %(message)s")
13+
"""
14+
A :obj:`logging.Formatter` that can be used to standardise logging across all projects using pydis_core.
15+
16+
:meta hide-value:
17+
"""
1218

1319

1420
class CustomLogger(LoggerClass):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pydis_core"
3-
version = "10.2.0"
3+
version = "10.3.0"
44
description = "PyDis core provides core functionality and utility to the bots of the Python Discord community."
55
authors = ["Python Discord <info@pythondiscord.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)