NLog :: add source line number to log

I need the line number of the source code to write the log via NLog.

Please let me know alternative ways to do this.

<<Log entry>> Line 23 
 <<Log entry>> Line 391

      

PS - 23, 391 - source code line numbers. Thanks to

+3


source to share


2 answers


You can use layout rendering $ {callsite: fileName = true} - specifies whether to display the source file name and line number. Documentation .



+4


source


Not sure, but you should try this. Hope this helps: D

http://iosdevelopertips.com/cocoa/filename-and-line-number-with-nslog-part-ii.html

and i also found this

NSLog(@"current line: %d",__LINE__);

      



from this How can I register the current row via NSLog in Cocoa / Objective C?

EDIT sry I don't know what you want C # should try to look at this

Do __LINE__ __FILE__ equivalents exist in C #?

-1


source







All Articles