T O P I C R E V I E W |
d_p_robinson |
Posted - Oct 13 2006 : 04:33:18 AM The documentation for Create Implementation autotext only lists the special symbols:
$SymbolContext$ $SymbolType$ $ParameterList$ $MethodQualifier$ $MethodBody$
I found that $SymbolName$ can also be used if needed (as we do for creating trace statements) for the method name on its own. Perhaps this should be added to the documentation. |
5 L A T E S T R E P L I E S (Newest First) |
jpizzi |
Posted - Oct 16 2006 : 10:49:35 PM I have put in a request to update the documentation. I don't believe that the frequency of this particular use of the variable is relevant.
case=3069 |
feline |
Posted - Oct 16 2006 : 10:42:32 AM this makes more sense now
plus, any "unexpected" overlap caused by one refactoring autotext rule being used for more than one refactoring operation will help, rather than hinder.
as for updating the documentation, I wonder how common this sort of thing is. |
d_p_robinson |
Posted - Oct 16 2006 : 04:36:50 AM I was indeed only suggesting adding the relevant sumbols to the documentation. I was not aware of the __FUNCTION__ macro - it loks very useful but we're still on VC6 and Wind River (ex Diab) cross-compiler, so it's probably not much use. The tracing/error reporting mechanism that we use goes like this: <start of file> #define CLASS_NAME "SomeClass" <each function> SomeClass::someFunction() { #undef OPERATION_NAME #define OPERATION_NAME "someFunction" }
Inside the function we can then use macros such as ERROR_LOG (printf-style args): #define ERROR_LOG (...) Log (CLASS_NAME OPERATION_NAME text, va_args) DEBUG_CATCH_BLOCK catch (const std::exception &ex) { ERROR_LOG ("%s", ex.what ()); }
And so on.
The overhead is extra code that may not be used. |
jpizzi |
Posted - Oct 13 2006 : 10:43:29 PM I believe that the OP is simply suggesting to add the $SymbolName$ "special symbol" to the documentation on the web page for Create Implementation. |
feline |
Posted - Oct 13 2006 : 08:15:25 AM are you aware of __FUNCTION__ ? this certainly exists in VS2005, but I am not sure which other IDE's. Personally I use a mixture of __FILE__, __LINE__ and __FUNCTION__ when inserting logging into my code.
depending on the changes you have made to Create Implementation you may get unexpected side effects, since this autotext rule is also used by Move Implementation to Source File.
Are you automatically adding a trace to every function that is created? That sounds like quite a lot of trace statements, even to me, and I have been known to insert a staggering number into my code when debugging nasty problems
What about an autotext rule to insert a trace statement? |