elvishew/xLog

如何追加信息到每个日志文件开头处

boiyun opened this issue · 3 comments

例如这样的:
image

Currently not support, you can copy the source code of FilePrinter and modify it by yourselves.
Will support the feature in the next release version.

@boiyun Now you can do like below:

    Printer filePrinter = new FilePrinter
        .Builder("your_log_path") 
        ...
        .writer(new SimpleWriter() {
          @Override
          public void onNewFileCreated(File file) {
            final String header = "xxx";
            appendLog(header);
          }
        })
        .build();

with release v1.11.0

Sorry, just saw the message, thank you