Skip to content

Commit

Permalink
Avoid duplicate logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoBar committed Nov 25, 2022
1 parent 5c76073 commit 5564f08
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions ikomia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import time
import logging

#----------------------------------
#----- Logging initialization -----
#----------------------------------
# ----------------------------------
# ----- Logging initialization -----
# ----------------------------------
logger = logging.getLogger(__name__)
logger.handlers = []
logger.setLevel(logging.DEBUG)
Expand All @@ -45,10 +45,11 @@
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(file_formatter)
logger.addHandler(file_handler)
logger.propagate = False

with open(log_path, "w") as f:
logger.info(f"Logging started at {time.strftime('%Y-%m-%d %H:%M:%S')}")
#----------------------------------
# ----------------------------------

from ikomia import utils
from ikomia.utils import autocomplete
Expand All @@ -59,17 +60,17 @@
__version__ = "0.8.1"


#----------------------------------------------
#----- Add built-in OpenCV to Python path -----
#----------------------------------------------
# ----------------------------------------------
# ----- Add built-in OpenCV to Python path -----
# ----------------------------------------------
if not utils.isAppStarted():
if sys.platform == "win32":
lib_path = os.path.dirname(os.path.realpath(__file__)) + os.sep + "lib"
sys.path.insert(0, lib_path)
os.environ["PATH"] += lib_path
else:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + os.sep + "opencv")
#----------------------------------------------
# ----------------------------------------------


global ik_api_session
Expand All @@ -79,15 +80,15 @@
ik_registry = None


#------------------------------------------
#----- Auto-completion initialization -----
#------------------------------------------
# ------------------------------------------
# ----- Auto-completion initialization -----
# ------------------------------------------
if not utils.isAppStarted():
ik_registry = registry.IkomiaRegistry()

if config.main_cfg["registry"]["auto_completion"]:
autocomplete.make_local_plugins()
#------------------------------------------
# ------------------------------------------


def authenticate():
Expand Down

0 comments on commit 5564f08

Please sign in to comment.