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

14
LINES

< > BotCompany Repo | #1013845 // logModuleOutput - logs all prints from module in {programID}/output.txt with time stamps

JavaX fragment (include)

sbool logModuleOutput_installed;

static void logModuleOutput() {
  if (logModuleOutput_installed) ret;
  logModuleOutput_installed = true;
  final File logFile = getProgramFile("output.txt");
  final LineBuffer buf = new(voidfunc(S line) {
    appendToTextFile(logFile, "[" + localDateWithMilliseconds() + "] " + line + "\n");
  });
  
  print_forAllThreads(voidfunc(S s) {
    buf.append(s);
  });
}

Author comment

Began life as a copy of #1006665

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: #1013845
Snippet name: logModuleOutput - logs all prints from module in {programID}/output.txt with time stamps
Eternal ID of this version: #1013845/6
Text MD5: 2b5d0aa98ee2f24da0f45e6730e69068
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-27 15:12:42
Source code size: 414 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 410 / 425
Version history: 5 change(s)
Referenced in: [show references]