I think it is only used for logging, so probably not worth worrying about what the compiler does.  I'm not sure it can optimize it, but given this won't be anywhere near critical path, having less than straightforward code won't be worth  it.