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

25
LINES

< > BotCompany Repo | #1000950 // autoReportToChat

JavaX fragment (include)

!include #1000947 // LineBuf
  
static void autoReportToChat() {
  Class javax = getJavaX();
  if (javax == null)
    die("Please use newer version of JavaX.");

  set(javax, "customSystemOut", new Appendable() {
    new LineBuf buf;
    
    // only using this one
    public Appendable append(CharSequence cs) {
      buf.append(cs.toString());
      while (true) {
        S s = buf.nextLine();
        if (s == null) break;
        reportToChat(s, true);
      }
      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 #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: 673 / 907
Referenced in: [show references]