Add support for t-strings in the stdlib logging library

If logging supports t-strings, this would work with a lazy string wrapper:

class Lazy:
    def __init__(self, callback):
        self.callback = callback
    def __str__(self):
        return str(self.callback())

logger.debug(t'Message with {Lazy(expensive_func1)}, {Lazy(expensive_func2)}')
2 Likes