# Integrating USD Tf.Warn with Python logging.Logger

**URL:** <https://forum.aousd.org/t/integrating-usd-tf-warn-with-python-logging-logger/1221>\
**Category:** USD\
**Tags:** python, beginner\
**Created:** [February 8, 2024, 10:17pm UTC](https://forum.aousd.org/t/integrating-usd-tf-warn-with-python-logging-logger/1221 "2024-02-08T22:17:02Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nvmkuruc](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nvmkuruc](https://forum.aousd.org/u/nvmkuruc)\
**Post date:** [September 9, 2024, 4:00pm UTC](https://forum.aousd.org/t/integrating-usd-tf-warn-with-python-logging-logger/1221/3 "2024-09-09T16:00:30Z")

</div>

Would it be reasonable for OpenUSD to try to convert `TfWarning` into python `warning` module warnings if there’s no registered delegate?

There are then multiple facilities in `warnings` module for silencing warnings, converting warnings to errors, or [converting them to `logging` module](https://docs.python.org/3/library/logging.html#logging.captureWarnings).

I suspect this could be implemented as a boost python call policy that sets some state on the `TfDiagnosticMgr` so that in `PostWarning`, instead of `_PrintDiagnostic`, [PyError\_Warn is called instead](https://docs.python.org/3/c-api/exceptions.html#issuing-warnings).

---

_[View the full topic](https://forum.aousd.org/t/integrating-usd-tf-warn-with-python-logging-logger/1221)._
