Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1006665 // logOutputPlain - logs all program output to disk in plain file output.txt

JavaX fragment (include)

static void logOutputPlain() {
  set(getJavaX(), "customSystemOut", new Appendable() {
    File logFile = getProgramFile("output.txt");
    
    // only using this one
    public Appendable append(CharSequence cs) {
      appendToTextFile(logFile, cs.toString());
      return this;
    }

    public Appendable append(char c) { return this; }
    public Appendable append(CharSequence s, int start, int end) { return this; }
  });
}

Author comment

Began life as a copy of #1002226

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006665
Snippet name: logOutputPlain - logs all program output to disk in plain file output.txt
Eternal ID of this version: #1006665/1
Text MD5: d1f994a6d4ee82b1e940d63acfc58619
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-27 03:51:23
Source code size: 446 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 497 / 517
Referenced in: [show references]