Added logging to most of the code

Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com>
Fixed bad logger logic

Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com>