Add support for log levels.

Yes, that we may introduce a better logging api and I'd like to reserve the shortest and best name for it.