Skip to content

Commit

Permalink
Stop initializing logger (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
juhhov authored Jun 13, 2024
1 parent a15d730 commit 50550cc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 46 deletions.
6 changes: 3 additions & 3 deletions lockable/lockable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from contextlib import contextmanager
from datetime import datetime
import json
import logging
import os
import random
import socket
Expand All @@ -12,12 +13,11 @@
from pid import PidFile, PidFileError

from lockable.allocation import Allocation
from lockable.logger import get_logger
from lockable.provider_helpers import create as create_provider
from lockable.unflatten import unflatten

MODULE_LOGGER = get_logger()
DEFAULT_TIMEOUT=1000
MODULE_LOGGER = logging.getLogger(__name__)
DEFAULT_TIMEOUT = 1000


class ResourceNotFound(Exception):
Expand Down
34 changes: 0 additions & 34 deletions lockable/logger.py

This file was deleted.

5 changes: 2 additions & 3 deletions lockable/provider.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
""" Provider library """
from abc import ABC, abstractmethod
import json
import logging
import typing
from typing import List

from pydash import filter_, count_by

from lockable.logger import get_logger

MODULE_LOGGER = get_logger()
MODULE_LOGGER = logging.getLogger(__name__)


class ProviderError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions lockable/provider_file.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
""" resources Provider for file """
import json
import logging
import os
from typing import List

from lockable.provider import Provider
from lockable.logger import get_logger

MODULE_LOGGER = get_logger()
MODULE_LOGGER = logging.getLogger(__name__)


class ProviderFile(Provider):
Expand Down
5 changes: 3 additions & 2 deletions lockable/provider_http.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
""" resources Provider for HTTP """
import logging

import requests
from requests import HTTPError, ConnectionError as RequestConnectionError
from requests.adapters import HTTPAdapter
Expand All @@ -7,9 +9,8 @@
from urllib3.exceptions import MaxRetryError

from lockable.provider import Provider, ProviderError
from lockable.logger import get_logger

MODULE_LOGGER = get_logger()
MODULE_LOGGER = logging.getLogger(__name__)


class RetryWithLogging(Retry):
Expand Down
5 changes: 3 additions & 2 deletions lockable/provider_list.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
""" resources Provider for static list """
from lockable.logger import get_logger
import logging

from lockable.provider import Provider

MODULE_LOGGER = get_logger()
MODULE_LOGGER = logging.getLogger(__name__)


class ProviderList(Provider):
Expand Down

0 comments on commit 50550cc

Please sign in to comment.