diff --git a/acto/input/input.py b/acto/input/input.py index c01253ee8..44c59bc96 100644 --- a/acto/input/input.py +++ b/acto/input/input.py @@ -164,6 +164,8 @@ def __init__( for doc in docs: example_docs.append(doc) for example_doc in example_docs: + logger = get_thread_logger(with_prefix=True) + logger.info("Loading example document %s", example_doc) self.root_schema.load_examples(example_doc) self.num_workers = num_workers diff --git a/acto/schema/array.py b/acto/schema/array.py index c2f74c7e2..045af19dc 100644 --- a/acto/schema/array.py +++ b/acto/schema/array.py @@ -1,7 +1,8 @@ -import logging import random from typing import List, Tuple +from acto.utils.thread_logger import get_thread_logger + from .base import BaseSchema, TreeNode @@ -102,7 +103,8 @@ def to_tree(self) -> TreeNode: return node def load_examples(self, example: list): - logging.debug(f"Loading example {example} into {self}") + logger = get_thread_logger(with_prefix=True) + logger.debug(f"Loading example {example} into {self}") self.examples.append(example) for item in example: self.item_schema.load_examples(item) diff --git a/acto/schema/object.py b/acto/schema/object.py index 05402b537..4323fab6a 100644 --- a/acto/schema/object.py +++ b/acto/schema/object.py @@ -1,4 +1,3 @@ -import logging import random from typing import List, Tuple @@ -130,7 +129,8 @@ def to_tree(self) -> TreeNode: return node def load_examples(self, example: dict): - logging.debug(f"Loading example {example} into {self}") + logger = get_thread_logger(with_prefix=True) + logger.debug(f"Loading example {example} into {self}") self.examples.append(example) for key, value in example.items(): if key in self.properties: diff --git a/acto/schema/string.py b/acto/schema/string.py index 3cc96cfa8..a28b6a67b 100644 --- a/acto/schema/string.py +++ b/acto/schema/string.py @@ -1,10 +1,10 @@ -import logging import random from typing import List, Optional, Tuple import exrex from acto.common import random_string +from acto.utils.thread_logger import get_thread_logger from .base import BaseSchema, TreeNode @@ -48,7 +48,8 @@ def to_tree(self) -> TreeNode: return TreeNode(self.path) def load_examples(self, example: str): - logging.debug(f"Loading example {example} into {self}") + logger = get_thread_logger(with_prefix=True) + logger.debug(f"Loading example {example} into {self}") self.examples.append(example) def set_default(self, instance):