<div dir="ltr">Hi All,<div><br></div><div>At the moment logging in LLDB done in the following way:</div><div>Log* log = GetLogIfAllCategoriesSet(...);</div><div>if (log)</div><div>    log->Printf(...);</div><div><br></div><div>This approach is clean and easy to understand but have the disadvantage of being a bit verbose. What is the general opinion about changing it to something like this?</div><div>Logger log = GetLogIfAllCategoriesSet(...);</div><div>log.Printf(...);</div><div><br></div><div>The idea would be to return a new type of object from GetLogIfAllCategoriesSet with small size (size of a pointer) what will check if the log category is enabled. From efficiency perspective this change would have no effect and it will simplify the writing of the logging statements.</div><div><br></div><div>Implementation details:</div><div>Logger would just contain a pointer to a Log object and forward all call to that object if that one isn't null. Additionally it will have a method to check for nullness of the underlying log object if we want to do some calculation only if the logging is enabled.</div><div><br></div><div>Thanks,</div><div>Tamas</div><div><br></div><div>P.S.: Other possible simplification in the logging system would be to use LogIfAllCategoriesSet but it require the specification of the log channel at each call and have a very minor overhead because of checking for the enabled log categories at each call.</div></div>