Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: black
name: Code Formatter (black)
- repo: 'https://github.com/PyCQA/flake8'
rev: 3.8.2
rev: 7.3.0
hooks:
- id: flake8
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_converters
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pydantic>=1.10,!=2.0.*
aiohttp~=3.8
boto3~=1.26
opencv-python-headless~=4.7
packaging~=24.0
packaging>=24.0,<26.0
plotly~=5.14
pandas~=2.0
pillow>=9.5,~=10.0
Expand Down
6 changes: 3 additions & 3 deletions requirements_extra.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
setuptools~=67.7
wheel~=0.40
Sphinx==6.2.1
tox==4.5.1
Sphinx~=6.2.1
tox~=4.0
sphinx_rtd_theme==1.2.0
furo==2023.3.27
jaraco.tidelift==1.5.1
sphinx-notfound-page==0.8.3
sphinx_inline_tabs==2023.4.21
pytest==7.3.1
pytest~=8.0
pytest-xdist==3.2.1
pytest-parallel==0.1.1
pytest-cov==4.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/superannotate/lib/app/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ def wrap_error(errors_list: List[Tuple[str, str]]) -> str:
_tabulation = tabulation - len(key)
if not key:
key, value, _tabulation = value, "", 0
msgs.append(f'{key}{ " " * _tabulation}{value}')
msgs.append(f'{key}{" " * _tabulation}{value}')
return "\n".join(msgs)
18 changes: 15 additions & 3 deletions src/superannotate/lib/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os
import sys
from logging import Formatter
from logging.handlers import RotatingFileHandler
from os.path import expanduser
Expand Down Expand Up @@ -36,10 +37,21 @@ def setup_logging(level=DEFAULT_LOGGING_LEVEL, file_path=LOG_FILE_LOCATION):
logger.removeHandler(handler)
logger.propagate = False
logger.setLevel(level)
stream_handler = logging.StreamHandler()

# Separate handlers for different log levels
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setLevel(logging.DEBUG)
stdout_handler.addFilter(lambda record: record.levelno < logging.WARNING)

stderr_handler = logging.StreamHandler(sys.stderr)
stderr_handler.setLevel(logging.WARNING)

formatter = Formatter("SA-PYTHON-SDK - %(levelname)s - %(message)s")
stream_handler.setFormatter(formatter)
logger.addHandler(stream_handler)
stdout_handler.setFormatter(formatter)
stderr_handler.setFormatter(formatter)

logger.addHandler(stdout_handler)
logger.addHandler(stderr_handler)
try:
os.makedirs(file_path, exist_ok=True)
log_file_path = os.path.join(file_path, "sa.log")
Expand Down