Skip to content

Commit

Permalink
chore: use function qualname for cleaner debug daemon logs (#327)
Browse files Browse the repository at this point in the history
* chore: use function qualname for cleaner debug daemon logs
  • Loading branch information
BobTheBuidler authored Oct 17, 2024
1 parent 2ade583 commit f9e8882
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion a_sync/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,16 @@ async def _debug_daemon(self, fut: asyncio.Future, fn, *args, **kwargs) -> None:
*args: Positional arguments for the function.
**kwargs: Keyword arguments for the function.
"""
# TODO: make prettier strings for other types
if type(fn).__name__ == "function":
fn = getattr(fn, '__qualname__', fn)

msg = f"%s processing %s{args}{kwargs}"

while not fut.done():
await asyncio.sleep(15)
if not fut.done():
self.logger.debug(f'{self} processing {fn}{args}{kwargs}')
self.logger.debug(msg, self, fn)

# Process

Expand Down

0 comments on commit f9e8882

Please sign in to comment.