A simple log file format

后端 未结 8 1153
广开言路
广开言路 2021-01-12 07:16

I\'m not sure if it was asked, but I couldn\'t find anything like this.

My program uses a simple .txt file for log purposes, It just creates/opens a file and appends

8条回答
  •  旧时难觅i
    2021-01-12 07:41

    First, check you're only logging things that are useful.

    If it's all useful, make sure it is easily parsable by tools such as grep, that way you can find the info you want. Make sure you have the type of log entry, the date/time all conforming to a layout.

    Build yourself a few scripts to extract the information for you. Alternatively, use separate log files for different types of entries.

提交回复
热议问题