The following are very common macros and expressions that are useful in log statements.
The preprocessing macro used in the C/c++/objective-c for log output.
Macro Format specifier Description
1. __func__%s before current function
2. Line numbers in __line__%d source files
3. __file__%s source file full path
4. __pretty_function__%s and __func__ are similar, but contain more information in C + + code.
Expressions for log output in Objective-c
Expression Format specifier Description
1. Nsstringfromselector (_cmd)%@//name of the current selector
2. Nsstringfromclass ([self class])%@//Name of the current object class
3. [[NSString stringwithutf8string:__file__] lastpathcomponent]%@//Name of source file
4. [Nsthread Callstacksymbols]%@//array of tick strings for the current stack information. For debugging purposes only, no need to show the end user or make any logic in the code.
iOS Log output macros