Skip to content

Commit

Permalink
Conditionally import FullSysLogHandler
Browse files Browse the repository at this point in the history
Import FullSysLogHandler
from CveXplore.core.logging.handlers.syslog_handler
only if configured (for Windows compatibility).
  • Loading branch information
oh2fih committed Aug 8, 2024
1 parent 30c8912 commit e47af77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CveXplore/core/logging/logger_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from CveXplore.common.config import Configuration
from CveXplore.core.logging.formatters.task_formatter import TaskFormatter
from CveXplore.core.logging.handlers.gelf_handler import GelfUDPHandler
from CveXplore.core.logging.handlers.syslog_handler import FullSysLogHandler

CRITICAL = 50
FATAL = CRITICAL
Expand Down Expand Up @@ -77,6 +76,11 @@ def __init__(self, name, level=logging.NOTSET):
),
)
else:
# Import syslog_handler only if configured (for Windows compatibility)
from CveXplore.core.logging.handlers.syslog_handler import (
FullSysLogHandler,
)

syslog = FullSysLogHandler(
address=(syslog_server, syslog_port),
facility=FullSysLogHandler.LOG_LOCAL0,
Expand Down

0 comments on commit e47af77

Please sign in to comment.