Skip to content

Commit

Permalink
Replaced logger with structlog's logger
Browse files Browse the repository at this point in the history
  • Loading branch information
ammar92 committed Sep 11, 2024
1 parent 42a297c commit 7e99081
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions octopoes/bits/definitions.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import importlib
import pkgutil
from functools import cache
from logging import getLogger
from pathlib import Path
from types import ModuleType

import structlog
from pydantic import BaseModel

from octopoes.models.types import OOIType

BITS_DIR = Path(__file__).parent
BIT_ATTR_NAME = "BIT"
logger = getLogger(__name__)
logger = structlog.get_logger(__name__)


class BitParameterDefinition(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
from collections.abc import Iterator
from typing import Any

Expand All @@ -10,8 +9,6 @@

LINK_SHORTENERS = link_shorteners_list()

logger = logging.getLogger(__name__)


def get_disallowed_hostnames_from_config(config, config_key, default):
disallowed_hostnames = config.get(config_key, None)
Expand Down
4 changes: 2 additions & 2 deletions octopoes/octopoes/api/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from collections import Counter
from collections.abc import Generator
from datetime import datetime
from logging import getLogger
from operator import itemgetter
from typing import Any, Literal

import structlog
from asgiref.sync import sync_to_async
from fastapi import APIRouter, Body, Depends, HTTPException, Path, Query, Request, status
from httpx import HTTPError
Expand Down Expand Up @@ -41,7 +41,7 @@
from octopoes.xtdb.query import Aliased
from octopoes.xtdb.query import Query as XTDBQuery

logger = getLogger(__name__)
logger = structlog.get_logger(__name__)
router = APIRouter(prefix="/{client}")


Expand Down
3 changes: 0 additions & 3 deletions octopoes/octopoes/repositories/origin_parameter_repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
from http import HTTPStatus
from logging import getLogger
from typing import Any

from httpx import HTTPStatusError
Expand All @@ -16,8 +15,6 @@
from octopoes.xtdb.client import XTDBSession
from octopoes.xtdb.query_builder import generate_pull_query

logger = getLogger(__name__)


class OriginParameterRepository(Repository):
def __init__(self, event_manager: EventManager):
Expand Down
3 changes: 0 additions & 3 deletions octopoes/octopoes/repositories/origin_repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
from http import HTTPStatus
from logging import getLogger
from typing import Any
from uuid import UUID

Expand All @@ -17,8 +16,6 @@
from octopoes.xtdb.client import XTDBSession
from octopoes.xtdb.query_builder import generate_pull_query

logger = getLogger(__name__)


class OriginRepository(Repository):
def __init__(self, event_manager: EventManager):
Expand Down
3 changes: 0 additions & 3 deletions octopoes/octopoes/repositories/scan_profile_repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
from http import HTTPStatus
from logging import getLogger
from typing import Any

from httpx import HTTPStatusError
Expand All @@ -16,8 +15,6 @@
from octopoes.xtdb.client import XTDBSession
from octopoes.xtdb.query_builder import generate_pull_query

logger = getLogger(__name__)


class ScanProfileRepository(Repository):
def __init__(self, event_manager: EventManager):
Expand Down

0 comments on commit 7e99081

Please sign in to comment.