Add support for log levels.
Fix issues from the code review.
Merge pull request #25 from rrch/f_log_level

Add support for log levels.