jina icon indicating copy to clipboard operation
jina copied to clipboard

Executor's logger doesn't work with square brackets surrounded ([{foo}]) "f-string" formatting

Open delgermurun opened this issue 3 years ago • 0 comments

Describe the bug

class FooGenerator(Executor):
    @requests(on='/')
    def generate(self, docs: DocumentArray, **kwargs):
        t = 'foo'
        self.logger.info(f'formatting "{t}"...')
        self.logger.info(f'formatting [{t}]...')
        print(f'formatting [{t}]...')

f = Flow().add(uses=FooGenerator)

with f:
    f.post(on='/')

above code generates following output

INFO   FooGenerator@93844 formatting "foo"...                                                                                                                                                 [08/04/22 14:54:06]
INFO   FooGenerator@93844 formatting ...                                                                                                                                                                         
formatting [foo]...

2nd line should be INFO FooGenerator@93844 formatting [foo]...

delgermurun avatar Aug 04 '22 12:08 delgermurun

upstream rich problem please raise a PR there

hanxiao avatar Aug 16 '22 15:08 hanxiao