Skip to content

Conversation

@ddkohler
Copy link
Contributor

@ddkohler ddkohler commented Nov 25, 2025

  • minor logging tweaks
  • adding PID information: knowledge of PID for a process is helpful for e.g. monitoring resource usage in a system monitor.
  • updated CHANGELOG.md
  • tests pass

helpful for finding process in a os system monitor
@ddkohler ddkohler marked this pull request as ready for review November 25, 2025 04:30
@ksunden
Copy link
Member

ksunden commented Dec 4, 2025

I don't fully love this... could maybe see it as a debug rather than info, but even then not fully convinced.

I also am not a huge fan of the other logging changes here, personally.

@ddkohler
Copy link
Contributor Author

ddkohler commented Dec 4, 2025

wrt PID I get it--it's awkward to fit it into logging. I don't like it as a debug message, because debug mode gets flooded with client comm info, so unless you log to file, you can lose PID pretty quickly. I am hoping PID is something you can fetch after the daemon has run for a while (e.g. if you notice after a daemon has large resource usage).

Another option would be to store it in state so clients can access it on demand, but I anticipated you would dislike that option more...do you have another proposal for how users can figure out what daemons are using resources on a computer?

wrt the other logging changes, they are mostly regarding brevity. I'll elaborate to make sure their case is made:

  • client connect/disconnect messages already have daemon name in the logging formatter, so it's redundant to include it in the message
  • removing time zone info is pretty self-explanatory--I can imagine a case where that could be useful on some world-crossing experimental setup to know what time zone a daemon or client logs some message, but in practice it seems like wasted space every message.
  • if a daemon is disabled in config, logger clocks it twice--once as info and once as error. Since disabling is not really an error for the typical end user, I propose to just log it as an info message...could be logged as error, I suppose, but I think the main thing is it only should be logged once.

@untzag
Copy link
Member

untzag commented Dec 19, 2025

@ddkohler can you tell us a story about when you would be looking at PIDs? I have basic questions like: why can't you use task manager?

@untzag
Copy link
Member

untzag commented Dec 19, 2025

By any chance is this about the new asyncio introspection features in 3.14?

https://docs.python.org/3/whatsnew/3.14.html#whatsnew314-asyncio-introspection

@ddkohler
Copy link
Contributor Author

Hey @untzag , the story is usually something along the lines of a daemon is using a surprising amount of resources (cpu or RAM) and I want to figure out what daemon it is. Task Manager lists all daemons as instances of python.exe (the entry point executable runs the daemon as a subprocess, so resources are not stored under the entry point task). When there are several python programs running, it is hard to discover the daemon you are after.

The introspection features are quite cool, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants