Skip to content

Commit

Permalink
Merge pull request #13 from Sefaria/feat/stdout-logs
Browse files Browse the repository at this point in the history
feat: stdout logging
  • Loading branch information
Paul-Yu-Chun-Chang authored Jul 17, 2024
2 parents a163c80 + 70230d0 commit 38c9089
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 5 additions & 5 deletions VirtualHavruta/util.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import sys
import logging
from logging import handlers
from typing import Iterable

from VirtualHavruta.document import ChunkDocument

from langchain_core.documents import Document

def create_logger(f='virtual-havruta.log', name='virtual-havruta', mb=1*1024*1024, bk=0):
def create_logger(name='virtual-havruta'):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
file_handler = logging.handlers.RotatingFileHandler(f, mode='a', maxBytes=mb, backupCount=bk, encoding=None, delay=0)
stdout_handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s : %(levelname)s : %(name)s : %(message)s')
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
stdout_handler.setFormatter(formatter)
logger.addHandler(stdout_handler)
return logger

def part_res(input_res, sep=''):
Expand Down
5 changes: 0 additions & 5 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ database:
name: db_name
neo4j_deeplink: http://neodash.graphapp.io/xyz


# Slack-related parameters
slack:
slack_bot_token: slack_bot_token
Expand All @@ -39,10 +38,6 @@ llm_chain_setups:
support_model: ['chain4', 'chain5', 'chain6']
support_model_json: []

# File paths
files:
log_path: ./data/virtual-havruta.log

# Reference Settings
references:
primary_source_filter: ['filter1', 'filter2', 'filter3']
Expand Down

0 comments on commit 38c9089

Please sign in to comment.