feat: Enhance logging and add chart endpoints

- Updated LoggerDB to remove all active sinks on initialization.
- Added a new PostgresCredencial setup in notas_mmr.py for database connection.
- Replaced print statements with logger calls for better logging in notas_mmr.py.
- Introduced new FastAPI endpoints for various chart types (bar, line, pie, scatter).
- Created Editor_biblioteca.css for styling the rich text editor.
- Implemented Editor_Test.tsx to test the rich text editor functionality.
This commit is contained in:
2025-06-01 00:33:48 +02:00
parent cf6a768f6b
commit 628cddc3ae
18 changed files with 5092 additions and 345 deletions
+5 -3
View File
@@ -11,9 +11,9 @@ class LoggerDB:
_sink_removido = False # ← evita múltiples remove() si se crean varias instancias
def __init__(self, credencial: PostgresCredencial, nombre_tabla: str, created_by: str = None):
if not LoggerDB._sink_removido:
logger.remove() # 🧹 elimina impresión en terminal
LoggerDB._sink_removido = True
# 🔥 Elimina todos los sinks activos, incluso los automáticos
logger.remove()
self.conexion = PostgresConexion(credencial)
self.engine = self.conexion.get_engine()
@@ -28,6 +28,8 @@ class LoggerDB:
def _generar_modelo_logger(self):
class LoggerTable(Model_base):
__tablename__ = self.nombre_tabla
__table_args__ = {'extend_existing': True} # 👈 Esta línea evita el error
id = Column(Integer, primary_key=True)
nivel = Column(String, nullable=False)
mensaje = Column(Text, nullable=False)