Mejoras y pequeños cambios en el log de la aplicación#38
Merged
euribates merged 1 commit intopythoncanarias:masterfrom Apr 5, 2026
Merged
Mejoras y pequeños cambios en el log de la aplicación#38euribates merged 1 commit intopythoncanarias:masterfrom
euribates merged 1 commit intopythoncanarias:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
La función trace está definida así:
def trace(self, msg):
self.logger.info('bot asked to execute /status commamd')
if self.verbose:
print(msg)
Evidentemente siempre loguea lo mismo: 'bot asked to execute /status commamd'
El módulo la llama 12 veces:
self.trace('bot asked to execute /status commamd')
self.trace(text)
self.trace('Received command /start')
self.trace('Received command /help')
self.trace('Received command /zen')
self.trace('Received new user event')
self.trace(f'Waiting {config.WELCOME_DELAY} seconds until user completes captcha...')
self.trace(f'Skipping welcome message, user {new_member.name} is no longer in the chat')
self.trace(f'send welcome message for {new_member.name}')
self.trace(f'bot sends reply {reply_spec.reply}')
self.trace('Starting bot...')
self.trace('Bot is ready')
Se cambiar la linea self.logger.info('bot asked to execute /status commamd') por self.logger.info(msg)
Se uniformizan los mensajes del log (uso de mayúsculas, etc).
Se ponen a nivel WARNING todos los logger de las librerías que use la aplicación.
Se pone a nivel config.LOG_LEVEL el log de la aplicación
Se genera un fichero log (bot.log) de la aplicación usando RotatingFileHandler
En modo verbose he sustituido el print por un manejador en consola: console_handler = StreamHandler()
Si el modo verbose no se activa, se usa el manejador console_handler = NullHandler()