Open vikramsubramanian opened 6 months ago
CustomHandler
class to ensure it does not modify Record.msg
inappropriately.format
method of the CustomHandler
class returns the original Record.msg
without additional formatting if that is the desired behavior.CustomHandler
is intended to apply specific formatting, adjust the format
method to conditionally format messages based on the handler's requirements.CustomHandler
is using Loguru's Handler
class, check if the emit
method is using record["message"]
directly for raw messages or if it is applying unnecessary formatting.CustomHandler
is meant to handle Loguru's Message
objects, ensure that the emit
method checks for is_raw
and uses record["message"]
as is when is_raw
is True
.CustomHandler
is meant to serialize the log record, ensure that the serialize
method or option is correctly implemented and does not alter the original message.CustomHandler
is using Loguru's Handler
class, ensure that the self._serialize
attribute is set to False
if serialization is not desired.CustomHandler
is using Loguru's Handler
class and the issue is with colorization, ensure that self._colorize
is set appropriately and that the Colorizer
class is used correctly.CustomHandler
is using Loguru's Handler
class and the issue is with dynamic formatting, ensure that self._is_formatter_dynamic
is set to False
if dynamic formatting is not desired.CustomHandler
is using Loguru's Handler
class and the issue is with exception formatting, ensure that formatter_record["exception"]
is set correctly in the emit
method.CustomHandler
is using Loguru's Handler
class and the issue is with message stripping, ensure that colored_message.stripped
is used correctly in the emit
method when is_raw
is True
.CustomHandler
is using Loguru's Handler
class and the issue is with precomputed formats, ensure that self._memoize_dynamic_format
and self._precolorized_formats
are used correctly in the emit
method.CustomHandler
is using Loguru's Handler
class and the issue is with queue handling, ensure that self._enqueue
is set correctly and that self._queue.put
is used correctly in the emit
method.CustomHandler
is using Loguru's Handler
class and the issue is with sink writing, ensure that self._sink.write
is used correctly in the emit
method.CustomHandler
is using Loguru's Handler
class and the issue is with stopping the handler, ensure that self._stopped
is checked correctly in the emit
method.
Reading
Record.msg
in a customlogging.Handler
implementation returns a formatted message instead of the original text. Since I need to use a different format for different handlers this is quite problematic. This is also different from the Python logging.Expected value:
"That's it, beautiful and simple logging!"
Actual value:
"2024-02-13 13:30:54.357 | DEBUG | __main__:run_it:31 - That's it, beautiful and simple logging!"
)