small optimiztion in logging