BewareMyPower commented on issue #11823:
URL: https://github.com/apache/pulsar/issues/11823#issuecomment-908841015


   I found the second issue as well. We can take a look at these two issues 
later.
   
   Regarding to this issue, could you upload you code `scratch.py` to 
reproduce? In my local env, `custom_logger_test.py` and the code in this PR 
work well. Here's my code with debug level logging.
   
   ```python
   import faulthandler
   import asyncio
   import logging
   
   from pulsar import Client
   
   def test():
       client = Client(
           service_url='pulsar://localhost:6650/',
           logger=logging.getLogger("foo")
       )
   
       async def async_func(rv):
           consumer = client.subscribe('sometopic', 'somesub')
           consumer.close()
           print("async returning", rv)
           return rv
   
       print("returned:", asyncio.run(async_func("bar")))
       client.close()
   
   
   if __name__ == '__main__':
       faulthandler.enable()
       logging.basicConfig(encoding='utf-8', level=logging.DEBUG)
       test()
   ```
   
   When I ran it, the output was like
   
   ```
   async returning bar
   2021-08-31 10:10:38.706 DEBUG [0x10afd1e00] ConsumerImpl:106 | 
[persistent://public/default/sometopic, somesub, 0] ~ConsumerImpl
   2021-08-31 10:10:38.706 DEBUG [0x10afd1e00] AckGroupingTrackerEnabled:100 | 
Reference to the HandlerBase is not valid.
   DEBUG:foo:Ignoring timer cancelled event, code[system:89]
   returned: bar
   ```
   
   You can see there're two lines that use the default logger.
   
   In your output, we can still see `StopIteration: bar` that should be printed 
by `PyErr_Print`. I didn't remove all `PyErr_Print` calls because I think they 
won't happen in some destructors. If you can provide code to reproduce, I can 
debug deeper for the cause.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to