Skip to content

Commit

Permalink
Merge pull request #114 from Integration-Automation/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JE-Chen authored Dec 15, 2024
2 parents 20c9fd0 + 18035eb commit 6beac49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "je_api_testka_dev"
version = "0.0.113"
version = "0.0.114"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
Expand Down
21 changes: 10 additions & 11 deletions je_api_testka/utils/logging/loggin_instance.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import logging

from logging.handlers import RotatingFileHandler
logging.root.setLevel(logging.DEBUG)
apitestka_logger = logging.getLogger("APITestka")
formatter = logging.Formatter('%(asctime)s | %(name)s | %(levelname)s | %(message)s')
# File handler
file_handler = logging.FileHandler(filename="APITestka.log", mode="w")
file_handler.setFormatter(formatter)
apitestka_logger.addHandler(file_handler)

class APITestkaLoggingHandler(logging.Handler):

class APITestkaLoggingHandler(RotatingFileHandler):

# redirect logging stderr output to queue

def __init__(self):
super().__init__()
def __init__(self, filename: str = "APITestka.log", mode="w",
maxBytes:int=1073741824, backupCount:int=0):
super().__init__(filename=filename, mode=mode, maxBytes=maxBytes, backupCount=backupCount)
self.formatter = formatter
self.setLevel(logging.DEBUG)

def emit(self, record: logging.LogRecord) -> None:
print(self.format(record))


# Stream handler
apitestka_logger.addHandler(APITestkaLoggingHandler())
# File handler
file_handler = APITestkaLoggingHandler()
file_handler.setFormatter(formatter)
apitestka_logger.addHandler(file_handler)
2 changes: 1 addition & 1 deletion stable.toml → pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "je_api_testka"
version = "0.0.125"
version = "0.0.126"
authors = [
{ name = "JE-Chen", email = "jechenmailman@gmail.com" },
]
Expand Down

0 comments on commit 6beac49

Please sign in to comment.