Add support for custom loggers.

Close #113
Close #94
weird indentation