xLog icon indicating copy to clipboard operation
xLog copied to clipboard

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

Open boiyun opened this issue 4 years ago • 3 comments

例如这样的: image

boiyun avatar Jul 09 '21 03:07 boiyun

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.

elvishew avatar Jul 11 '21 08:07 elvishew

@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

elvishew avatar Jul 11 '21 17:07 elvishew

Sorry, just saw the message, thank you

boiyun avatar Aug 04 '21 02:08 boiyun