CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post
    And, Arjay, I'm still not sure what you're talking about...
    Think back to previous posts and what your comments were to other folks that posted code in an effort to help you. I can think of two recent examples involving Igor and myself and those are only recent ones. Think about it.

  2. #17
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function

    What? Arjay, you didn't drink anything this morning, did you

  3. #18
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post
    What? Arjay, you didn't drink anything this morning, did you
    Sure he didn't!
    AFAIK Arjay drinks only once a year - in the last evening of Global MVP summit and not more than one shot!
    So, ahmd, relax! Take it easy!
    Victor Nijegorodov

  4. #19
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function



    Hey, I remember I ran into a thread here with pictures of some of this forum's mvps. Is it still somewhere?

  5. #20
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post


    Hey, I remember I ran into a thread here with pictures of some of this forum's mvps. Is it still somewhere?
    Maybe... I don't know ...
    Victor Nijegorodov

  6. #21
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post
    Igor, first of all, you contradict yourself. You say that I should keep my logging to a bare minimum because of the log size concerns and then tell me to include "human readable text in every log record along with printing pairs (critical variable = value) inside the text".
    First of all I said you should not log in spartan/laconic style, but your logs must be human readable. And keeping your logging of moderate size was only a secondary comment. So, as for me, no contradiction at all.

    And I can see that having your logs readable enough without referring to sources makes not much sense to you. The same to levels (and subsystems, though it's not that common in practice like levels). Something makes me believe it's only a matter of time.

    It is also much easier to find the code lines in the source code by their ID rather then by a discriptive text.
    You must be kidding. Is that so difficult to find a descriptive text, when you know the exact function name including class name? Remember I said primary id is __FUNCTION__ but not descriptive text?

    The exact log text entry might also get distorted when passed from one person to another.
    The log text must not be passed from one person to another. The log files must be instead.

    One more reason is that it's always easy to refer to a particular bug by its ID number among the members of our development team.
    This sounds not very convincing to me: "you know, the client reported 587 tonight. Again!" Sorry, I don't believe you, my people never talk like that.

    For your information, we use referring to a bug (inside developers team as well as between development and validation departments) not by it's placement in the source code but by its id in bug tracking system. And always it is accompanied with verbal comments about visible effects and workflow details. Very few people I know are really good at distinguishing big numbers just by hearing them.

    And a bug typically appears a complex of (cross)effects caused by various combinations of reasons, and almost never it is a syntax error (or anything else same stupid) in a single line. I wish I had such bugs all the time!

    I did use __LINE__ and __FUNCTION__ in my logging before, but sometimes it gives out too much information about the code.
    It's never too late to change your mind. Let's have a deal: you use your spartan id system say for a year or a half, and then share with us your impressions and improvements. Agree?
    Last edited by Igor Vartanov; August 10th, 2010 at 04:34 PM.
    Best regards,
    Igor

  7. #22
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function

    IDK, it's just nice to add a face to words ... I see you already did that, Victor

    Anyway, if someone knows the link, please post it here...

    So, did you guys all meet at that Global MVP summit? Where was it, btw?

  8. #23
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by Igor Vartanov View Post
    It's never too late to change your mind. Let's have a deal: you use your spartan id system say for a year or a half, and then share with us your impressions and improvements. Agree?
    Sure.

    Well, we clearly have some different approaches to logging. I've been doing this for quite a long time and never had problems with it (nor the people that work with me.)

  9. #24
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Ways to insert unique ID into a logging function

    I've been doing this for quite a long time and never had problems with it
    Sorry, my impression was the idea is something new to you. My bad.
    Best regards,
    Igor

  10. #25
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by Igor Vartanov View Post
    Sorry, my impression was the idea is something new to you. My bad.
    In case I came off wrong in my previous posts, here's an example of a log that may be generated by my software:
    10193> 8/10/2010 2:55:11 PM : [0087] = >Initiating a new <name> process: Elevated. Cmd line: /ptr /log=1
    10193> 8/10/2010 2:55:11 PM : [0095] = >[OS: Microsoft Windows XP Professional Service Pack 3 (build 2600). LOCALE: English_United States.1252]
    10193> 8/10/2010 2:54:57 PM : [0560] = **OS_ERR: (2) "C:/Blah-blah-blah" The system cannot find the file specified.
    10193> 8/10/2010 2:54:57 PM : [0567] = **INT_ERR
    10193> 8/10/2010 2:54:58 PM : [0176] = Exiting process now, ret code = -24
    In the sample above, 10193 is a version of the program. Then date & time when the event was logged (unless it's the Windows own Event Log), then our unique ID in the square brackets, followed by a description, where possible. In case of the OS error, it is reported too (line 3), or in case of a code/logic specific error, it's reported relative to the unique ID (line 4)

  11. #26
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Arrow Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post
    Hey, I remember I ran into a thread here with pictures of some of this forum's mvps. Is it still somewhere?
    Looks like you are talking about the photo album thread in the Chit Chat section. The link, BTW, wouln't even really be necessary: The thread is sticky and thus always on top pf the list.

  12. #27
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function

    Nice, dude! 155 pages It may take the whole day to go through.....

  13. #28
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post
    Nice, dude! 155 pages It may take the whole day to go through.....
    If you're only looking for Arjay: There's an index in the first posts, or you could use the forum search feature.

  14. #29
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by Eri523 View Post
    If you're only looking for Arjay: There's an index in the first posts, or you could use the forum search feature.
    Ha-ha-ha... No, I'm not looking for Arjay But he is a big dude... so I should probably stop taunting him... he might kick my a_s_s

    PS. Cool, so it was in Seattle... it's like an hour away from me.

  15. #30
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Ways to insert unique ID into a logging function

    Quote Originally Posted by ahmd View Post
    PS. Cool, so it was in Seattle... it's like an hour away from me.
    And where are you (if it's not a top secret)?
    Victor Nijegorodov

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured