File tree 2 files changed +2
-9
lines changed
2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change 14
14
from bespokelabs .curator .constants import _CURATOR_DEFAULT_CACHE_DIR
15
15
from bespokelabs .curator .db import MetadataDB
16
16
from bespokelabs .curator .llm .prompt_formatter import PromptFormatter
17
- from bespokelabs .curator .log import logger
17
+ from bespokelabs .curator .log import add_file_handler , logger
18
18
from bespokelabs .curator .request_processor ._factory import _RequestProcessorFactory
19
19
from bespokelabs .curator .request_processor .config import BackendParamsType
20
20
@@ -218,6 +218,7 @@ def __call__(
218
218
219
219
run_cache_dir = os .path .join (curator_cache_dir , fingerprint )
220
220
os .makedirs (run_cache_dir , exist_ok = True )
221
+ add_file_handler (run_cache_dir )
221
222
222
223
session_id = self ._request_processor .viewer_client .create_session (metadata_dict )
223
224
metadata_dict ["session_id" ] = session_id
Original file line number Diff line number Diff line change 5
5
from rich .console import Console
6
6
from rich .logging import RichHandler
7
7
8
- from bespokelabs .curator .constants import _CURATOR_DEFAULT_CACHE_DIR
9
-
10
8
LOG_FORMAT = "%(asctime)s | %(levelname)-8s | %(module)s:%(lineno)d - %(message)s"
11
9
ROOT_LOG_LEVEL = logging .DEBUG
12
10
@@ -29,14 +27,8 @@ def _init_logger(self):
29
27
self .logger = logging .getLogger ("curator" )
30
28
self .logger .setLevel (ROOT_LOG_LEVEL )
31
29
if not self .logger .handlers :
32
- log_file = os .path .join (os .path .expanduser (_CURATOR_DEFAULT_CACHE_DIR ), "curator.log" )
33
- formatter = logging .Formatter (LOG_FORMAT )
34
- file_handler = logging .handlers .RotatingFileHandler (log_file , maxBytes = 5 * 1024 * 1024 , backupCount = 5 )
35
- file_handler .setLevel (logging .DEBUG )
36
- file_handler .setFormatter (formatter )
37
30
rich_handler = RichHandler (console = _CONSOLE )
38
31
rich_handler .setLevel (logging .INFO )
39
- self .logger .addHandler (file_handler )
40
32
41
33
self .logger .addHandler (rich_handler )
42
34
You can’t perform that action at this time.
0 commit comments