From c49615aab6db3aeda7833b97ff05bffaebf8f85c Mon Sep 17 00:00:00 2001 From: Michal Tuszowski Date: Sat, 16 Aug 2025 18:56:34 +0200 Subject: [PATCH] debug --- latex_commands.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/latex_commands.py b/latex_commands.py index 168ad56..d0afe35 100644 --- a/latex_commands.py +++ b/latex_commands.py @@ -43,10 +43,10 @@ class LatexModule(commands.Cog): for att in atts: try: data = await att.read() - self.logger.debug("LaTeX read %s bytes from %s", len(data), att.filename) + self.logger.info("LaTeX read %s bytes from %s", len(data), att.filename) res = await compile_single_tex_bytes(data, att.filename, LATEX_TEX_ENGINE, LATEX_MAX_COMPILE_SECONDS, logger=self.logger) - self.logger.debug("LaTeX result for %s: %s", att.filename, res) - self.logger.debug("LaTeX log (%s)\n%s", att.filename, (res["log_text"] or "")[-2000:]) + self.logger.info("LaTeX result for %s: %s", att.filename, res) + self.logger.info("LaTeX log (%s)\n%s", att.filename, (res["log_text"] or "")[-2000:]) if res["ok"] and res["pdf_bytes"]: b = io.BytesIO(res["pdf_bytes"]) b.seek(0) @@ -54,6 +54,7 @@ class LatexModule(commands.Cog): files.append(discord.File(b, filename=res["pdf_name"])) parts.append(f"✅ `{att.filename}` → `{res['pdf_name']}`") else: + self.logger.info("LaTeX compile failed for %s", att.filename) excerpt = "" if include_source_excerpt: try: @@ -63,7 +64,7 @@ class LatexModule(commands.Cog): advice = await ask_openai_diagnosis(res["log_text"] or "", excerpt, OPENAI_MODEL, logger=self.logger) parts.append(f"❌ `{att.filename}` — błąd kompilacji.\nDiagnoza:\n{advice}") except Exception as e: - self.logger.debug("Exception %s: %s", att.filename, e) + self.logger.info("Exception %s: %s", att.filename, e) parts.append(f"⚠️ `{att.filename}` — wyjątek (szczegóły w logu).") content = f"**LaTeX** — {len(atts)} plik(ów). Model: `{OPENAI_MODEL}`\n\n" + "\n\n".join(parts)