Skip to content

Commit

Permalink
chore: change name logger to fit with the name of the library (#97)
Browse files Browse the repository at this point in the history
Renamed the logger to `copernicusmarine` to fit with the convention that the logger is usually with the same name as the library
  • Loading branch information
renaudjester committed Aug 20, 2024
1 parent 1ceef2c commit 4c1df02
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion copernicusmarine/catalogue_parser/catalogue_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
rolling_batch_gather,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


MARINE_DATA_STORE_STAC_BASE_URL = (
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/catalogue_parser/request_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
TemporalParameters,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


MAPPING_REQUEST_FILES_AND_REQUEST_OPTIONS: dict[str, str] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sys import exit
from typing import Callable

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def _log_exception(log_function: Callable, exception: Exception):
Expand Down
4 changes: 2 additions & 2 deletions copernicusmarine/command_line_interface/group_describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
from copernicusmarine.core_functions.describe import describe_function

logger = logging.getLogger("copernicus_marine_root_logger")
blank_logger = logging.getLogger("copernicus_marine_blank_logger")
logger = logging.getLogger("copernicusmarine")
blank_logger = logging.getLogger("copernicusmarine_blank_logger")


@click.group()
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/command_line_interface/group_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
OVERWRITE_SHORT_OPTION,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


@click.group()
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/command_line_interface/group_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from copernicusmarine.core_functions.login import login_function

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


@click.group()
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/command_line_interface/group_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
OVERWRITE_SHORT_OPTION,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


@click.group()
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/credentials_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
get_configured_requests_session,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")

USER_DEFINED_CACHE_DIRECTORY: str = (
COPERNICUSMARINE_CREDENTIALS_DIRECTORY or ""
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/custom_open_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
from copernicusmarine.core_functions.utils import parse_access_dataset_url

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


class CustomS3Store(MutableMapping):
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import click

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def get_deprecated_message(old_value, preferred_value):
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)
from copernicusmarine.core_functions.versions_verifier import VersionVerifier

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def describe_function(
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/environment_variables.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import os

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")

COPERNICUSMARINE_SERVICE_USERNAME = os.getenv(
"COPERNICUSMARINE_SERVICE_USERNAME"
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
download_original_files,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def get_function(
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
credentials_file_builder,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def login_function(
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/services_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
get_size_of_coordinate_subset,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


class _Command(Enum):
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)
from copernicusmarine.download_functions.utils import FileFormat

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def subset_function(
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from copernicusmarine import __version__ as copernicusmarine_version

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")

OVERWRITE_SHORT_OPTION = "--overwrite"
OVERWRITE_LONG_OPTION = "--overwrite-output-data"
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/core_functions/versions_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
construct_query_params_for_marine_data_store_monitoring,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


class VersionVerifier:
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/download_functions/common_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
NetCDFCompressionNotAvailable,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def get_delayed_download(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
get_formatted_dataset_size_estimation,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def _rechunk(dataset: xarray.Dataset) -> xarray.Dataset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
parse_access_dataset_url,
)

logger = logging.getLogger("copernicus_marine_root_logger")
blank_logger = logging.getLogger("copernicus_marine_blank_logger")
logger = logging.getLogger("copernicusmarine")
blank_logger = logging.getLogger("copernicusmarine_blank_logger")

NUMBER_THREADS = (
int(COPERNICUSMARINE_GET_CONCURRENT_DOWNLOADS)
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/download_functions/subset_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
TemporalParameters,
)

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")

COORDINATES_LABEL = {
"latitude": ["latitude", "nav_lat", "x", "lat"],
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/download_functions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from copernicusmarine.download_functions.subset_xarray import COORDINATES_LABEL

logger = logging.getLogger("copernicus_marine_root_logger")
logger = logging.getLogger("copernicusmarine")


def get_file_extension(file_format: FileFormat) -> str:
Expand Down
4 changes: 2 additions & 2 deletions copernicusmarine/logging_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
},
},
"loggers": {
"copernicus_marine_blank_logger": {
"copernicusmarine_blank_logger": {
"handlers": ["console_blank"],
"level": "INFO",
"propagate": False,
},
"copernicus_marine_root_logger": {
"copernicusmarine": {
"handlers": ["console"],
"level": "INFO",
},
Expand Down

0 comments on commit 4c1df02

Please sign in to comment.