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

18
LINES

< > BotCompany Repo | #2000490 // debugOn

New Tinybrain snippet

  static void debugOn(String name) {
    try {
      Class c = getClass("main$" + name);
      if (c == null) c = getClass(name);
      Field field;
      while (true)
        try {
          field = c.getDeclaredField("debug");
          break;
        } catch  (NoSuchFieldException e) {
          c = c.getSuperclass();
        }
      field.setBoolean(null, true);
    } catch (Exception e) {
      e.printStackTrace();
      System.err.println("Cannot debug class " + name);
    }
  }

download  show line numbers   

Snippet is not live.

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

No comments. add comment

Snippet ID: #2000490
Snippet name: debugOn
Eternal ID of this version: #2000490/1
Text MD5: 3f9394022700c30e58c99fa3511d6304
Author: stefan
Category:
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-02 20:16:44
Source code size: 506 bytes / 18 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 481 / 456
Referenced in: [show references]