Click here to Skip to main content
15,887,464 members
Home / Discussions / C#
   

C#

 
AnswerRe: Any fast way to get the stack trace? Pin
fengyuancom3-Oct-14 18:13
fengyuancom3-Oct-14 18:13 
AnswerRe: Any fast way to get the stack trace? Pin
Pete O'Hanlon4-Oct-14 0:55
mvePete O'Hanlon4-Oct-14 0:55 
AnswerRe: Any fast way to get the stack trace? Pin
Dave Kreskowiak4-Oct-14 3:36
mveDave Kreskowiak4-Oct-14 3:36 
GeneralRe: Any fast way to get the stack trace? Pin
SledgeHammer014-Oct-14 6:02
SledgeHammer014-Oct-14 6:02 
GeneralRe: Any fast way to get the stack trace? Pin
Dave Kreskowiak4-Oct-14 7:17
mveDave Kreskowiak4-Oct-14 7:17 
GeneralRe: Any fast way to get the stack trace? Pin
SledgeHammer014-Oct-14 12:36
SledgeHammer014-Oct-14 12:36 
GeneralRe: Any fast way to get the stack trace? Pin
Dave Kreskowiak4-Oct-14 12:42
mveDave Kreskowiak4-Oct-14 12:42 
GeneralRe: Any fast way to get the stack trace? Pin
SledgeHammer014-Oct-14 14:08
SledgeHammer014-Oct-14 14:08 
Dave Kreskowiak wrote:
Uhhhh....yeah. Whatever.


No need for rudeness dude. I think you're just very confused. In my previous response, I **AGREED** with you and said you *probably* aren't going to get a high volume of log calls requesting a stack trace. As I said, my logger is configurable. You don't have to request a stack trace, but you *CAN*. Or you can log stuff *WITHOUT* requesting a stack trace. Not every log entry will want a stack trace. For example, with my request log at work, I certainly don't want a stack trace, but I do want one in my exception log. The exception log doesn't have a million rows as I **AGREED** with you in my last response, it has a much lower volume.

As artificial intelligence has not yet been perfect, how would you suggest a logger component know which log entry will need a stack trace? Yes, I can add a bool to the logger call, or I can make it a bit more automated as I plan to do. Although a bool in the logger call would give the user much more control then the automated detection method.

Dave Kreskowiak wrote:
Think about that for a minute. What are you going to get in the stack trace? A million examinations of the call to the log component!


UHHH... HUH?

You don't just pull log entries out of your ass, man. You log stuff in specific locations. For my request log, I log the request at the entry point of the service. For my exception log, I log stuff in exception handlers. If you've ever used an exception handler, you should know full and well that you get the stack trace of the **actual exception** and not the call into the logger.

Like wise, if I put a logger call in SomeClass.SomeMethod() you don't get the call stack of the call into the logger component, you get the call stack of the call into SomeClass.SomeMethod(). That's why its called a STACK dude. Its recursive.

Speaking of the call into the logger, do you think I'm an idiot or something? Why would a user want to see the call stack of the logger? They would **NOT**. So I skip over those frames. **Just like every other logger on the market does**.

Dave Kreskowiak wrote:
You're basically not going to get what you would call a "high performance" stack trace. The operation is just too expensive.


If you knew at all how stack traces work, you'd know that a stack trace is actually quite fast. Its the file & line info that's slow since you need to parse that out of the PDB file.

Hey, have you ever used the StackTrace class? Did you notice Microsoft put a bool on there to specify if you want the file & line info or not? Did you think that bool was put in there for your amusement? It was actually put in there because obtaining the file & line info is the majority of the time spent on the stack trace.

Anyways... thanks for your useful feedback, I think I've got what I need.
GeneralRe: Any fast way to get the stack trace? Pin
Dave Kreskowiak4-Oct-14 18:52
mveDave Kreskowiak4-Oct-14 18:52 
QuestionTextarea not able insert large text Pin
sreekanth.jonna3-Oct-14 10:48
sreekanth.jonna3-Oct-14 10:48 
SuggestionRe: Textarea not able insert large text Pin
George Jonsson5-Oct-14 15:04
professionalGeorge Jonsson5-Oct-14 15:04 
QuestionNeed to send an email 20 minutes before the event time Pin
VladFromNYC3-Oct-14 9:48
VladFromNYC3-Oct-14 9:48 
AnswerRe: Need to send an email 20 minutes before the event time Pin
BillWoodruff3-Oct-14 10:58
professionalBillWoodruff3-Oct-14 10:58 
GeneralRe: Need to send an email 20 minutes before the event time Pin
VladFromNYC3-Oct-14 11:30
VladFromNYC3-Oct-14 11:30 
GeneralRe: Need to send an email 20 minutes before the event time Pin
SledgeHammer013-Oct-14 11:46
SledgeHammer013-Oct-14 11:46 
GeneralRe: Need to send an email 20 minutes before the event time Pin
VladFromNYC6-Oct-14 4:48
VladFromNYC6-Oct-14 4:48 
QuestionHow to find in useful/unnecessary files from website folder ??? Pin
Abhishek kumar1213-Oct-14 6:07
Abhishek kumar1213-Oct-14 6:07 
AnswerRe: How to find in useful/unnecessary files from website folder ??? Pin
ZurdoDev3-Oct-14 7:12
professionalZurdoDev3-Oct-14 7:12 
QuestionEdit Equation in RichtextBox WPF Pin
Member 106106383-Oct-14 3:53
Member 106106383-Oct-14 3:53 
AnswerRe: Edit Equation in RichtextBox WPF Pin
SledgeHammer013-Oct-14 6:59
SledgeHammer013-Oct-14 6:59 
QuestionWhat should be update query ??? Pin
Abhishek kumar1213-Oct-14 1:42
Abhishek kumar1213-Oct-14 1:42 
AnswerRe: What should be update query ??? Pin
Richard Deeming3-Oct-14 2:23
mveRichard Deeming3-Oct-14 2:23 
QuestionConverting Crystal Reports into Bitmap format Pin
itani1-Oct-14 20:03
itani1-Oct-14 20:03 
QuestionRe: Converting Crystal Reports into Bitmap format Pin
Richard MacCutchan1-Oct-14 21:43
mveRichard MacCutchan1-Oct-14 21:43 
AnswerRe: Converting Crystal Reports into Bitmap format Pin
Bernhard Hiller1-Oct-14 23:18
Bernhard Hiller1-Oct-14 23:18 

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

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