<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>i am a developer and i need your help. </div>log a debug message, the recommend way as follow ,<div> <span style="font-family: Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace; white-space: pre-wrap; "><span style="color: rgb(0, 0, 0); ">logger</span><span style="color: rgb(102, 102, 0); ">.</span><span style="color: rgb(0, 0, 0); ">debug</span><span style="color: rgb(102, 102, 0); ">(</span><span style="color: rgb(0, 136, 0); ">"The entry is {}."</span><span style="color: rgb(102, 102, 0); ">,</span><span style="color: rgb(0, 0, 0); "> entry</span><span style="color: rgb(102, 102, 0); ">);</span></span></div>
<div><span style="font-family: Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace; white-space: pre-wrap; "><span style="color: rgb(102, 102, 0); ">it is more efficiency.Because it avoids the cost of parameter construction<font face="Verdana, Arial, SunSans-Regular, sans-serif"> if the debug is disabled for logger.</font></span></span></div>
<div><span></span><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">but if i want to log an info message ,which of the two way is better?</span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; "></span><span style="white-space: pre-wrap; "><span style="color: rgb(0, 0, 0); "><span style="color: rgb(0, 0, 0); ">logger</span><span style="color: rgb(102, 102, 0); ">.</span><span style="color: rgb(0, 0, 0); ">info</span><span style="color: rgb(102, 102, 0); ">(</span><span style="color: rgb(0, 136, 0); ">"The entry is {}."</span><span style="color: rgb(102, 102, 0); ">,</span><span style="color: rgb(0, 0, 0); "> entry</span><span style="color: rgb(102, 102, 0); ">);</span></span></span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; "><span style="color: rgb(0, 0, 0); "><span style="color: rgb(102, 102, 0); "></span></span>or</span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; "><span style="color: rgb(0, 0, 0); "><span style="color: rgb(0, 0, 0); ">logger</span><span style="color: rgb(102, 102, 0); ">.</span><span>info</span><span style="color: rgb(102, 102, 0); ">(</span><span style="color: rgb(0, 136, 0); ">"The entry is " </span><span><font color="#666600">+ </font></span><span style="color: rgb(0, 0, 0); ">entry+"."</span><span style="color: rgb(102, 102, 0); ">);</span></span></span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; "><br></span></font></div><div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">because my system's log level always is info,so "</span></font><span style="font-family: Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace; color: rgb(102, 102, 0); white-space: pre-wrap; ">avoids the cost of parameter construction" such problem is not exist, but the first way </span></div>
<div><span style="font-family: Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace; color: rgb(102, 102, 0); white-space: pre-wrap; "></span><span style="font-family: Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace; white-space: pre-wrap; "><span style="color: rgb(0, 0, 0); ">logger</span><span style="color: rgb(102, 102, 0); ">.</span><span style="color: rgb(0, 0, 0); ">info</span><span style="color: rgb(102, 102, 0); ">(</span><span style="color: rgb(0, 136, 0); ">"The entry is {}."</span><span style="color: rgb(102, 102, 0); ">,</span><span style="color: rgb(0, 0, 0); "> entry</span><span style="color: rgb(102, 102, 0); ">)</span></span></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">seems like that it needs more work to do than the second way,for example it needs to find the "{}" at least. And i guess it's directly output the string without matching the "{}" in the second way. </span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">so in that situation, i think the second way is better.</span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">is that right?</span></font></div><div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; "><br>
</span></font></div><div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; "><br></span></font></div><div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">waiting for your answers</span></font></div>
<div><font color="#666600" face="Courier, 'MS Courier New', Prestige, 'Everson Monocourrier', monospace"><span style="white-space: pre-wrap; ">thank you</span></font></div></span>