reduce INFO logging

This commit is contained in:
Andreas Köpf
2023-02-04 20:26:20 +01:00
parent effbde407a
commit f02543b36f
5 changed files with 18 additions and 8 deletions
+1
View File
@@ -59,6 +59,7 @@ jobs:
${{ vars.WEB_NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN_CAPTCHA }}
WEB_NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN:
${{ vars.WEB_NEXT_PUBLIC_ENABLE_EMAIL_SIGNIN }}
LOGURU_LEVEL: ${{ vars.LOGURU_LEVEL }}
steps:
- name: Checkout
uses: actions/checkout@v2
+3
View File
@@ -149,6 +149,9 @@
USER_STATS_INTERVAL_TOTAL:
"{{ lookup('ansible.builtin.env', 'STATS_INTERVAL_TOTAL') |
default('240', true) }}"
LOGURU_LEVEL:
"{{ lookup('ansible.builtin.env', 'LOGURU_LEVEL') | default('INFO',
true) }}"
ports:
- "{{ backend_port }}:8080"
+2 -1
View File
@@ -104,7 +104,8 @@ def tasks_acknowledge(
pr = PromptRepository(db, api_client, frontend_user=frontend_user)
# here we store the message id in the database for the task
logger.info(f"Frontend acknowledges task {task_id=}, {ack_request=}.")
logger.info(f"Frontend ACK task_id={task_id}")
logger.debug(f"{ack_request=}.")
pr.task_repository.bind_frontend_message_id(task_id=task_id, frontend_message_id=ack_request.message_id)
except OasstError:
+2 -2
View File
@@ -166,8 +166,8 @@ class Settings(BaseSettings):
DATABASE_URI: Optional[PostgresDsn] = None
DATABASE_MAX_TX_RETRY_COUNT: int = 3
DATABASE_POOL_SIZE = 128
DATABASE_MAX_OVERFLOW = 128
DATABASE_POOL_SIZE = 75
DATABASE_MAX_OVERFLOW = 20
RATE_LIMIT: bool = True
MESSAGE_SIZE_LIMIT: int = 2000
+10 -5
View File
@@ -623,7 +623,8 @@ class TreeManager:
HTTPStatus.SERVICE_UNAVAILABLE,
)
logger.info(f"Generated {task=}.")
logger.info(f"Generated task (type={task.type}, id={task.id})")
logger.debug(f"Generated {task=}.")
return task, message_tree_id, parent_message_id
@@ -634,8 +635,9 @@ class TreeManager:
match type(interaction):
case protocol_schema.TextReplyToMessage:
logger.info(
f"Frontend reports text reply to {interaction.message_id=} with {interaction.text=} by {interaction.user=}."
f"Frontend reports text reply to message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.text=}")
# here we store the text reply in the database
message = pr.store_text_reply(
text=interaction.text,
@@ -682,23 +684,26 @@ class TreeManager:
case protocol_schema.MessageRating:
logger.info(
f"Frontend reports rating of {interaction.message_id=} with {interaction.rating=} by {interaction.user=}."
f"Frontend reports rating of message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.rating=}")
pr.store_rating(interaction)
case protocol_schema.MessageRanking:
logger.info(
f"Frontend reports ranking of {interaction.message_id=} with {interaction.ranking=} by {interaction.user=}."
f"Frontend reports ranking of message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.ranking=}")
_, task = pr.store_ranking(interaction)
self.check_condition_for_scoring_state(task.message_tree_id)
case protocol_schema.TextLabels:
logger.info(
f"Frontend reports labels of {interaction.message_id=} with {interaction.labels=} by {interaction.user=}."
f"Frontend reports labels of message_id={interaction.message_id} by user={interaction.user}."
)
logger.debug(f"with {interaction.labels=}")
_, task, msg = pr.store_text_labels(interaction)