How would I check to see if my computer went to sleep?

JPigford

I'm awesome...seriously..
I have a program that scheduled to run in the background even when the program itself isn't open but it won't run if my computer is asleep. I've set my Energy Saver to never put my computer to sleep but the program still isn't running. So I'm wanting to check and see if my computer does/doesn't go to sleep.
 
If you don't see the sleep light "sleeping", aka winking on and off, it's not sleeping. And if you have EnergySaver to never sleep, it's not going to sleep unless you do it manually.
 
Randman said:
If you don't see the sleep light "sleeping", aka winking on and off, it's not sleeping. And if you have EnergySaver to never sleep, it's not going to sleep unless you do it manually.
Well obviously in a perfect world that would be the case but I'm not convinced that it's obeying my settings. So, my original question still stands.
 
I wonder if there's a way to write some apple script to log the sleep of the machine in the console - or if it already does something like that...

sorry, not an answer per se, but maybe get you in the right direction
 
Open Console (/Applications/Utilities/Console) and check the System log (in the File menu). You'll see entries like this:

Code:
Feb 17 12:10:03 localhost kernel: AFPSleepWakeHandler:  going to sleep
Feb 17 12:10:03 localhost kernel: AppleNMI mask NMI
Feb 17 12:10:03 localhost kernel: AirPort:  Link DOWN 
Feb 17 12:10:03 localhost mDNSResponder[168]: mDNSResponder Sleeping at 181795567
Feb 17 12:33:26 localhost kernel: System Sleep

The easy approach is to hit Command+F, and search for System Sleep.
 
Open console.app and look in the system.log file. All sleep events are recorded there for instance I have

Feb 16 17:21:44 localhost kernel: AppleLMUController: setLEDFade - Fade to brightness level: 0x00000000.
Feb 17 09:48:47 localhost kernel: System Sleep
Feb 17 09:48:47 localhost kernel: System Wake
Feb 17 09:48:47 localhost kernel: Wake event 0008

The only thing that is odd is that the system sleep message is logged at wakeup, but when you think about it that does make sense. It is asleep after all.

Edit: I should refresh before answering a question that has been sitting open in a window all morning. D'oh!
 
You can still tell by looking at all the network services going to sleep before the actual System Sleep event is logged. It probably occurs just mere seconds after those are dealt with.
 
Back
Top