static polymorphism

Switched the hierarchy to static polymorphism.

Unfortunately, dynamic polymorphism is still necessary at one place. Thus one virtual function call still exists for each log statement.

Nevertheless, there are two benefits:
1. Speedup on deeper hierarchies.
2. User doesn't need to implement two overloads of the write_to_log function. (prefect forwarding is recommended here)