logtrace: add const modifier to the APIs

Compiler may do more optimization when the parameter is const.
logtrace: add log_session_lvl

log_session_lvl is suitable for performance critical places where in
most cases, the log is turned off by level. If the session is const and
the level is greater than session->lvl, the whole function will be
optimized out.
Merge pull request #260 from grissiom/logtrace-next

Logtrace next