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

13
LINES

< > BotCompany Repo | #1004190 // androidLifecycle - log to lifecycle.txt

JavaX fragment (include)

import java.text.SimpleDateFormat;

static void androidLifecycle(O line) ctex {
  if (line instanceof Throwable) line = getStackTrace((Throwable) line);
  
  line = "[" + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()) + "] " + line;
  String path = "/storage/sdcard0/JavaX_System/lifecycle.txt";
  new File(path).getParentFile().mkdirs();
  RandomAccessFile raf = new RandomAccessFile(path, "rw");
  raf.seek(raf.length());
  raf.write((line + "\n").getBytes("UTF-8"));
  raf.close();
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004190
Snippet name: androidLifecycle - log to lifecycle.txt
Eternal ID of this version: #1004190/1
Text MD5: db31391afda37a6591d77cc64903eb60
Author: stefan
Category: javax / android
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-09 17:24:42
Source code size: 514 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 563 / 551
Referenced in: [show references]