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

10
LINES

< > BotCompany Repo | #1017322 // Redirect System.out & System.err to log file (and keep printing normally, OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (5565L/40K).

!7

p-exp {
  FileOutputStream fileOut = newFileOutputStream(print(programFile("log.txt")));
  System.setOut(teePrintStream(System.out, fileOut));
  System.setErr(teePrintStream(System.err, fileOut));
  repeat with sleep 10 {
    print("Yo");
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017322
Snippet name: Redirect System.out & System.err to log file (and keep printing normally, OK)
Eternal ID of this version: #1017322/3
Text MD5: 9259ae66839f4e11c9bb189fae8be548
Transpilation MD5: 9dc3c63869de07d8cffc9d9997521dde
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-16 21:19:11
Source code size: 257 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 265 / 647
Version history: 2 change(s)
Referenced in: [show references]