mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-11 12:59:01 +08:00
Fixed log not displaying (#3946)
### What problem does this PR solve? Fixed log not displaying ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
41a0601735
commit
7a6bf4326e
1
.github/workflows/tests.yml
vendored
1
.github/workflows/tests.yml
vendored
@ -54,6 +54,7 @@ jobs:
|
|||||||
uses: astral-sh/ruff-action@v2
|
uses: astral-sh/ruff-action@v2
|
||||||
with:
|
with:
|
||||||
version: ">=0.8.2"
|
version: ">=0.8.2"
|
||||||
|
args: "check --ignore E402"
|
||||||
|
|
||||||
- name: Build ragflow:nightly-slim
|
- name: Build ragflow:nightly-slim
|
||||||
run: |
|
run: |
|
||||||
|
@ -18,10 +18,11 @@
|
|||||||
# from beartype.claw import beartype_all # <-- you didn't sign up for this
|
# from beartype.claw import beartype_all # <-- you didn't sign up for this
|
||||||
# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
|
# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
|
||||||
|
|
||||||
|
from api.utils.log_utils import initRootLogger
|
||||||
|
initRootLogger("ragflow_server")
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from api.utils.log_utils import initRootLogger
|
|
||||||
|
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -41,9 +42,6 @@ from api.versions import get_ragflow_version
|
|||||||
from api.utils import show_configs
|
from api.utils import show_configs
|
||||||
from rag.settings import print_rag_settings
|
from rag.settings import print_rag_settings
|
||||||
|
|
||||||
LOG_LEVELS = os.environ.get("LOG_LEVELS", "")
|
|
||||||
initRootLogger("ragflow_server", LOG_LEVELS)
|
|
||||||
|
|
||||||
|
|
||||||
def update_progress():
|
def update_progress():
|
||||||
while True:
|
while True:
|
||||||
|
@ -28,7 +28,7 @@ def get_project_base_directory():
|
|||||||
)
|
)
|
||||||
return PROJECT_BASE
|
return PROJECT_BASE
|
||||||
|
|
||||||
def initRootLogger(logfile_basename: str, log_levels: str, log_format: str = "%(asctime)-15s %(levelname)-8s %(process)d %(message)s"):
|
def initRootLogger(logfile_basename: str, log_format: str = "%(asctime)-15s %(levelname)-8s %(process)d %(message)s"):
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
if logger.hasHandlers():
|
if logger.hasHandlers():
|
||||||
return
|
return
|
||||||
@ -48,8 +48,9 @@ def initRootLogger(logfile_basename: str, log_levels: str, log_format: str = "%(
|
|||||||
|
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
|
|
||||||
|
LOG_LEVELS = os.environ.get("LOG_LEVELS", "")
|
||||||
pkg_levels = {}
|
pkg_levels = {}
|
||||||
for pkg_name_level in log_levels.split(","):
|
for pkg_name_level in LOG_LEVELS.split(","):
|
||||||
terms = pkg_name_level.split("=")
|
terms = pkg_name_level.split("=")
|
||||||
if len(terms)!= 2:
|
if len(terms)!= 2:
|
||||||
continue
|
continue
|
||||||
|
@ -22,11 +22,11 @@ from rag.utils import num_tokens_from_string
|
|||||||
from . import rag_tokenizer
|
from . import rag_tokenizer
|
||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
|
import json
|
||||||
import roman_numbers as r
|
import roman_numbers as r
|
||||||
from word2number import w2n
|
from word2number import w2n
|
||||||
from cn2an import cn2an
|
from cn2an import cn2an
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import json
|
|
||||||
|
|
||||||
import chardet
|
import chardet
|
||||||
|
|
||||||
|
@ -17,13 +17,14 @@
|
|||||||
# from beartype.claw import beartype_all # <-- you didn't sign up for this
|
# from beartype.claw import beartype_all # <-- you didn't sign up for this
|
||||||
# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
|
# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
|
||||||
|
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
|
|
||||||
from api.utils.log_utils import initRootLogger
|
from api.utils.log_utils import initRootLogger
|
||||||
|
CONSUMER_NO = "0" if len(sys.argv) < 2 else sys.argv[1]
|
||||||
|
CONSUMER_NAME = "task_executor_" + CONSUMER_NO
|
||||||
|
initRootLogger(CONSUMER_NAME)
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
@ -57,11 +58,6 @@ from rag.utils import rmSpace, num_tokens_from_string
|
|||||||
from rag.utils.redis_conn import REDIS_CONN, Payload
|
from rag.utils.redis_conn import REDIS_CONN, Payload
|
||||||
from rag.utils.storage_factory import STORAGE_IMPL
|
from rag.utils.storage_factory import STORAGE_IMPL
|
||||||
|
|
||||||
CONSUMER_NO = "0" if len(sys.argv) < 2 else sys.argv[1]
|
|
||||||
CONSUMER_NAME = "task_executor_" + CONSUMER_NO
|
|
||||||
LOG_LEVELS = os.environ.get("LOG_LEVELS", "")
|
|
||||||
initRootLogger(CONSUMER_NAME, LOG_LEVELS)
|
|
||||||
|
|
||||||
BATCH_SIZE = 64
|
BATCH_SIZE = 64
|
||||||
|
|
||||||
FACTORY = {
|
FACTORY = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user