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

14
LINES

< > BotCompany Repo | #1002226 // logOutput - logs all program output to disk

JavaX fragment (include)

1  
static void logOutput() {
2  
  set(getJavaX(), "customSystemOut", new Appendable() {
3  
    File logFile = getProgramFile("output.log");
4  
    
5  
    // only using this one
6  
    public Appendable append(CharSequence cs) {
7  
      logQuoted(logFile, cs.toString());
8  
      return this;
9  
    }
10  
11  
    public Appendable append(char c) { return this; }
12  
    public Appendable append(CharSequence s, int start, int end) { return this; }
13  
  });
14  
}

Author comment

Began life as a copy of #1000950

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

Comments [hide]

ID Author/Program Comment Date
1201 stefan Do not use with autoReportToChat 2015-12-30 00:34:13

add comment

Snippet ID: #1002226
Snippet name: logOutput - logs all program output to disk
Eternal ID of this version: #1002226/1
Text MD5: 882eeae53d6dde5421b55b30bf502f68
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:49:58
Source code size: 434 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 937 / 1139
Referenced in: [show references]