Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gu <[email protected]>
  • Loading branch information
tylergu committed Sep 6, 2024
1 parent 0bb67e6 commit 9238384
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions acto/schema/array.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging
import random
from typing import List, Tuple

from utils.thread_logger import get_thread_logger

from .base import BaseSchema, TreeNode


Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions acto/schema/object.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
import random
from typing import List, Tuple

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions acto/schema/string.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
import random
from typing import List, Optional, Tuple

import exrex
from utils.thread_logger import get_thread_logger

from acto.common import random_string

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 9238384

Please sign in to comment.