I think it's a good practice to check the flag to avoid any calculations such as string concatenation on the parameters of the debug().