Skip to content

Commit

Permalink
Updated logger to use pathlib
Browse files Browse the repository at this point in the history
  • Loading branch information
jrichardson97 committed Mar 27, 2024
1 parent 72df1a0 commit 8d767e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions kg_summarizer/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

logger = LoggingUtil.init_logging(
__name__,
level=logging.INFO,
level=logging.DEBUG,
format_sel="medium",
)

Expand All @@ -42,7 +42,7 @@ class EdgeItem(BaseModel):
parameters: Parameters


KG_SUM_VERSION = "0.0.11"
KG_SUM_VERSION = "0.0.12"

# declare the application and populate some details
app = FastAPI(
Expand Down
5 changes: 3 additions & 2 deletions kg_summarizer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
from logging.handlers import RotatingFileHandler
import os
import pathlib


class LoggingUtil(object):
Expand All @@ -15,8 +16,8 @@ class LoggingUtil(object):
def init_logging(
name, level=logging.INFO, format_sel="medium", log_file_level=None
):
log_file_path = os.path.join(
os.path.dirname(__file__), "../logs/kg_summarizer.log"
log_file_path = (
pathlib.Path(__file__).parents[1].joinpath("logs/kg_summarizer.log")
)
# get a logger
logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="kg-summarizer",
version="0.0.11",
version="0.0.12",
author="Joey Richardson",
author_email="[email protected]",
url="https://github.com/jrichardson97/kg-summarizer",
Expand Down

0 comments on commit 8d767e0

Please sign in to comment.