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

25
LINES

< > BotCompany Repo | #1000950 // autoReportToChat

JavaX fragment (include)

1  
!include #1000947 // LineBuf
2  
  
3  
static void autoReportToChat() {
4  
  Class javax = getJavaX();
5  
  if (javax == null)
6  
    die("Please use newer version of JavaX.");
7  
8  
  set(javax, "customSystemOut", new Appendable() {
9  
    new LineBuf buf;
10  
    
11  
    // only using this one
12  
    public Appendable append(CharSequence cs) {
13  
      buf.append(cs.toString());
14  
      while (true) {
15  
        S s = buf.nextLine();
16  
        if (s == null) break;
17  
        reportToChat(s, true);
18  
      }
19  
      return this;
20  
    }
21  
22  
    public Appendable append(char c) { return this; }
23  
    public Appendable append(CharSequence s, int start, int end) { return this; }
24  
  });
25  
}

Author comment

Began life as a copy of #1000949

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: #1000950
Snippet name: autoReportToChat
Eternal ID of this version: #1000950/1
Text MD5: 95a47579c9ee9366db4e91fa0a2fe937
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-11 17:24:21
Source code size: 660 bytes / 25 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 579 / 826
Referenced in: [show references]