Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5959 uses logging config at module level #5960

Merged
merged 1 commit into from
Feb 8, 2023
Merged
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
8 changes: 4 additions & 4 deletions monai/fl/client/monai_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import logging
import os
import sys
from collections.abc import Mapping, MutableMapping
from typing import Any, cast

Expand All @@ -22,6 +21,7 @@

import monai
from monai.apps.auto3dseg.data_analyzer import DataAnalyzer
from monai.apps.utils import get_logger
from monai.auto3dseg import SegSummarizer
from monai.bundle import DEFAULT_EXP_MGMT_SETTINGS, ConfigComponent, ConfigItem, ConfigParser, patch_bundle_tracking
from monai.engines import SupervisedTrainer, Trainer
Expand All @@ -41,7 +41,7 @@
from monai.utils import min_version, require_pkg
from monai.utils.enums import DataStatsKeys

logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(asctime)s - %(message)s")
logger = get_logger(__name__)


def convert_global_weights(global_weights: Mapping, local_var_dict: MutableMapping) -> tuple[MutableMapping, int]:
Expand Down Expand Up @@ -116,7 +116,7 @@ def __init__(
data_stats_transform_list: list | None = None,
histogram_only: bool = False,
):
self.logger = logging.getLogger(self.__class__.__name__)
self.logger = logger
self.bundle_root = bundle_root
self.config_train_filename = config_train_filename
self.config_filters_filename = config_filters_filename
Expand Down Expand Up @@ -405,7 +405,7 @@ def __init__(
data_stats_transform_list: list | None = None,
tracking: str | dict | None = None,
):
self.logger = logging.getLogger(self.__class__.__name__)
self.logger = logger
if config_evaluate_filename == "default":
# by default, evaluator needs both training and evaluate to be instantiated.
config_evaluate_filename = ["configs/train.json", "configs/evaluate.json"]
Expand Down