How do I keep my mac from going into sleep mode? I have tried setting the energy saver setting sleep to never. I tried both Caffeine and NoSleep apps. I've tried setting pmset sleep to 0. I read somewhere that it might be the lid sensor which is on the ribbon cable for the battery light indicator, so I disconnected it but it would still go to sleep. I've also tried resetting the SMC, and it made no difference. Not sure what is wrong. I'm running 10.9.3 on a Macbook Pro mid 2009.

Update: http://pastebin.com/7Q3aVZam Power Management logs
Thanks for your help Graham, but I decided to take a look at my logic board and found some places that had been corroded. I removed my logic board and gave it a good clean with isopropyl alcohol and a toothbrush and for now my mac has stopped going to sleep on its own, also fans are back to normal.