Add support for log levels.

I made it optional.