Flexible logging framework