Troubleshooting a mac that won't go to sleep

I have a small issue where my macbook won't go to sleep on lid-closing when it's connected to a power supply. I remember having this problem a few weeks ago, and I found this command that could help me debug it. The command works since I would run this command and then close my lid. When I opened the lid, I could see that it was registered the lid was closed and what prevented it from sleeping.

I've tried most of the pmset ones, and I don't think that's it. (It might be though?)

I'm not necessarily looking for that exact one, so my question is:

Any monitoring tools (preferably terminal or command-line) that shows the log of what happens when I close the lid?


pslog

Have you tried the pmset command for live debugging?

pmset -g pslog

-g pslog displays an ongoing log of power source (battery and UPS) state.