Interaction between programs and programmers, mostly logs

Source: Internet
Author: User
ProgramIf a problem occurs, or you want to record the test and tracking information, you can capture sensitive information and email it to the author. In actual operations, most logs are used.

. Net Framework has debug, and the trace class can do this. It is lightweight and good, and does not require additional classes. However, it is slightly insufficient to handle logs with complicated requirements, I have written a logging class. Even if I cannot make it a good experience, I believe it will not be a burden.

Introduction:

Writelog is a base class that defines common variables and methods;
Writetxtlog: inherits writelog and provides the method to write information to a TXT file;
Timer2txt: inherits writetxtlog and provides a public arraylist to process information in arraylist. The objective is to process a large amount of data. When multiple methods have log processing requirements, all log information is placed in arraylist, it is processed independently by timer2txt to prevent concurrent writes to the same log and exclusively process the logs.
Writexmllog: simple function. It only writes information to an XML file and needs to be further improved.

The above classes can be used at will. The methods are public and determined based on actual needs.
Strongname can be stored in GAC. Therefore, variables and methods in the class can be instantiated without static.
Download: pierce.log.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.