Logging and event handling the Erlang/OTP way