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

chore: change name logger to fit with the name of the library #97

Merged
merged 1 commit into from
Jul 22, 2024
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 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")

Comment on lines +16 to 17
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this blank logger for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically to distiguish between normal logging and when you return true "outputs" of the program!

We use it in the describe and in the get when you do --show-outputnames


@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 @@ -25,7 +25,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