Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HamletSargsyan committed Oct 5, 2024
1 parent 6f2ccdf commit 61d63e3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## [2.2.0] - 2024-10-05

### Fixed

- Issue #2

## [2.1.0] - 2024-10-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tinylogging"
version = "2.1.0"
version = "2.2.0"
description = ""
authors = ["Hamlet <[email protected]>"]
license = "MIT"
Expand Down
17 changes: 16 additions & 1 deletion src/tinylogging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
from colorama import Fore, Style


__all__ = [
"Level",
"COLOR_MAP",
"Record",
"Formatter",
"BaseHandler",
"StreamHandler",
"FileHandler",
"LoggingAdapterHandler",
"Logger",
]


class Level(IntEnum):
NOTSET = auto()
TRACE = auto()
Expand Down Expand Up @@ -129,7 +142,9 @@ def __init__(

def emit(self, record: logging.LogRecord):
level = Level[record.levelname] # cspell: disable-line
custom_record = Record(message=self.format(record), level=level, name=record.name)
custom_record = Record(
message=self.format(record), level=level, name=record.name
)
self.custom_handler.handle(custom_record)


Expand Down

0 comments on commit 61d63e3

Please sign in to comment.