Formatting trace output

前端 未结 7 1030
南笙
南笙 2020-12-29 09:14

I\'m using TextWriterTraceListener to log diagnostics messages to a text file. However I wan\'t also to log a timestamp of every trace message added. Is it poss

7条回答
  •  心在旅途
    2020-12-29 09:41

    You could write your own TextWriterTraceListener subclass which overrides the WriteLine methods, decorates the line, and then passes the decorated string to the base class implementation to do the actual output.

提交回复
热议问题