Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

in my job I need to log a big number of files in C++ for a project where I need to reegineer an existing functionality without any help.
I want to log a big amount of files.
I see that you have the good level of abstraction,
since you use graphviz to visualize dependency graph. and it s great !!!

best regards and thanks in advance for any help and thanks again for sharing !!!
Posted

wrote:
I see that you have the good level of abstraction,
since you use graphviz to visualize dependency graph. and it s great !!!


What on earth are you talking about. Are you referring to an article somewhere ?

I don't really understand what it is you need to log. I would write a class with static methods that you can then call from where-ever you like to provide logging. I actually wrote an article for WDJ years ago that used windows messages between applications to provide logging in real time in a release build if my logging app was running to show the logs, but if you want to write them to files, then yes, you want to abstract out the code that handles the logging, and call it as needed.
 
Share this answer
 
I can only guess that you are in need to add logging capability to your application? Then simply search CP. There are plenty of articles on how to accomplish it.
 
Share this answer
 
I am speaking about using something like Visual Studio Macro
to insert in every function a code line
C++ MACRO which prints in a log file the name of the used function
and since there are 500 files
I want to make the insert of this code line automated

And sorry about the graphViz (it was a mistake)

thanks for your answer
 
Share this answer
 
Please edit your post, don't post 'answers' that are just more questions.

You can use a macro to log something, if you want. It's obviously then not abstracted, or in any way pretty. macros are nasty. However, there is no way to automate what you want to do. The main reason to use a macro is that it's inserted inline, which means it can report the file and line number it was called from. But, you're still going to have to insert them yourself, unless you want a generic log at the top of every method call or something similarly formulaic, in which case you may be able to write code to parse your code files and do it for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900