It depends on what "param" actually is. If this is a complex expression, it is better to use isTraceEnabled . If this is just an object reference, you can use it directly. Its toString method is called only when tracing is enabled.
Using isTraceEnabled also useful if the string isTraceEnabled multiple trace statements. You can put them in the same if , then.
Henry source share