CFY-1522 created cli logging configuration + added debug flag to all com...

...mand
move if to caller