remove trailing whitespace
log to module logger (instead of global one)