Skip to content

Experimental: switch logging to loguru#291

Open
antirotor wants to merge 1 commit into
developfrom
chore/use-loguru-for-logging
Open

Experimental: switch logging to loguru#291
antirotor wants to merge 1 commit into
developfrom
chore/use-loguru-for-logging

Conversation

@antirotor
Copy link
Copy Markdown
Member

Changelog Description

Loguru is a library which aims to bring enjoyable logging in Python. AYON was already customizing logging to handle some colorization and contextualization but using loguru will allow to do it with more consistency and in standard way. It also simplify connecting logging facility to some telemetry/log aggregation system.

Additional info

This is still in proof-of-concept phase. Formatting in set now in ayon-launcher and propagated down the line but it can be changed. Logs are processed by rich and you can add various markup to the log messages to format it further:

log.info("this message [red]will be red[/red]")

It also has its automatic highlighting (that might need some tweaks) that can be disabled and customized.

Rich itself has some very useful features not related to logging, like very nice pretty printing, etc.

It produces output like this now:
image

(notice wrong highlighting on timing info that needs to be fixed)

Stuff to add

  • simple api to add custom sinks for addons like ayon-vector (or others) and even before the addons are available - to serialize and send logs out
  • investigate way to use it for publishing logs to make it universal across the system

Note

To test it, you'll need also PR from ayon-core

@antirotor antirotor self-assigned this Mar 5, 2026
@antirotor antirotor added the type: enhancement Improvement of existing functionality or minor addition label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant