Click here to Skip to main content
Licence 
First Posted 3 Oct 2000
Views 68,174
Bookmarked 32 times

Simple trace format tips

By | 4 Oct 2000 | Article
A simple way to format your TRACE statements so double clicking takes you directly to the source code.
  • Download demo project - 6 Kb
  • Introduction

    When writing TRACE statements to the output window in DevStudio it is often useful to be able to go directly to the section of code that produced the TRACE output. Doing this is simple - you just use the __FILE__ and __LINE__ macros in your TRACE statements.

    If you format your TRACE statement as follows:

    TRACE(_T("%s(%i) : Please double click on me!\n"), __FILE__,__LINE__);

    then you can double click on the TRACE output line and be taken directly to the line of code the produced the TRACE statement.

    An example of using this can be find in the enclosed example. Note that in the example I used the CDuration class by Laurent Guinnard.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Audrius Vasiliauskas

    Business Analyst

    Lithuania Lithuania

    Member



    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralDebug Logs PinmemberPaul Grew2:13 8 Feb '01  
    GeneralThis (and more) has been a part of ATL/AUX for 2 years... PinsussAndrew Nosenko11:15 9 Oct '00  
    GeneralI like it, but... PinsussPaul Westcott6:52 5 Oct '00  
    GeneralHow to make it even shorter PinsussHelmut Mülner22:31 5 Oct '00  
    GeneralRe: How to make it even shorter PinsussPaul Westcott5:24 6 Oct '00  
    GeneralRe: I like it, but... PinmemberAnonymous4:58 30 Jul '01  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.5.120517.1 | Last Updated 5 Oct 2000
    Article Copyright 2000 by Audrius Vasiliauskas
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid