Refactoring log command. Fixes #56