se migran los print de los módulos a logging con nivel explícito
pipeline_utils.log pasa a usar logging (parámetro severity) y los print de pipeline, sapb1_manager, hana_manager, outlook_utilities, email_utilities y main pasan a logger.info/warning/error, de modo que LOG_LEVEL filtre por severidad. El texto del log no cambia. Se mantienen los print de CLI en sunat_schema (__main__), tools/ y tests/. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5ef9c90fc0
commit
3fa26e3ef6
11 files changed
+109
-79
No files matched your search
+6
-3
@@ -1,9 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
import logging
|
||||
import os
|
||||
from datetime import datetime, date
|
||||
from hdbcli import dbapi
|
||||
from dotenv import load_dotenv
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# ============================================================================
|
||||
# CONFIGURACIÓN
|
||||
# ============================================================================
|
||||
@@ -31,7 +34,7 @@ def get_connection():
|
||||
)
|
||||
return conn
|
||||
except Exception as e:
|
||||
print(f" ❌ Error conectando a HANA: {e}")
|
||||
logger.error(f" ❌ Error conectando a HANA: {e}")
|
||||
return None
|
||||
|
||||
# ============================================================================
|
||||
@@ -89,7 +92,7 @@ def _query_delivery_table(connection, tabla: str, tipo: str, serie: str, numero:
|
||||
results.append(registro)
|
||||
return results
|
||||
except Exception as e:
|
||||
print(f" ❌ Error en consulta HANA get_delivery ({tabla}): {e}")
|
||||
logger.error(f" ❌ Error en consulta HANA get_delivery ({tabla}): {e}")
|
||||
return []
|
||||
finally:
|
||||
if cursor:
|
||||
@@ -127,7 +130,7 @@ def obtener_valor_referencial(serie: str, numero: str) -> float:
|
||||
valor = dict(zip(columns, row)).get("ValorReferencial")
|
||||
return float(valor) if valor is not None else 0.0
|
||||
except Exception as e:
|
||||
print(f" ❌ Error en consulta HANA obtener_valor_referencial: {e}")
|
||||
logger.error(f" ❌ Error en consulta HANA obtener_valor_referencial: {e}")
|
||||
return 0.0
|
||||
finally:
|
||||
if cursor:
|
||||
|
||||
Reference in new issue
Block a user