{"action":"created","comment":{"url":"https://api.github.com/repos/plume-lib/bcel-util/pulls/comments/176923955","pull_request_review_id":106714084,"id":176923955,"diff_hunk":"@@ -0,0 +1,98 @@\n+package org.plumelib.bcelutil;\n+\n+/*>>>\n+import org.checkerframework.checker.formatter.qual.*;\n+import org.checkerframework.checker.initialization.qual.*;\n+import org.checkerframework.checker.nullness.qual.*;\n+*/\n+\n+/**\n+ * A logging class with the following features:\n+ *\n+ * <ul>\n+ *   <li>Can be enabled and disabled (when disabled, all operations are no-ops),\n+ *   <li>Can indent/exdent log output,\n+ *   <li>Writes to standard output, and\n+ *   <li>Can provide a backtrace\n+ * </ul>\n+ */\n+public final class SimpleLog {\n+\n+  /** If false, do no output. */\n+  public boolean enabled;\n+\n+  /** The current indentation string. */\n+  private String indent_str = \"\";\n+  /** Indentation string for one level of indentation. */\n+  public final String INDENT_STR_ONE_LEVEL = \"  \";\n+\n+  /**\n+   * Create a new SimpleLog object.\n+   *\n+   * @param enabled whether the logger starts out enabled\n+   */\n+  public SimpleLog(boolean enabled) {\n+    this.enabled = enabled;\n+  }\n+\n+  public SimpleLog() {\n+    this(true);\n+  }\n+\n+  public boolean enabled() {\n+    return enabled;\n+  }\n+\n+  /**\n+   * Log a message.\n+   *\n+   * @param format format string for message\n+   * @param args values to be substituted into format\n+   */\n+  /*@FormatMethod*/\n+  public void log(String format, /*@Nullable*/ Object... args) {\n+    if (enabled) {\n+      System.out.print(indent_str);\n+      System.out.printf(format, args);\n+    }\n+  }\n+\n+  /** Print a backtrace (traceback, or tb) to the log. */\n+  public void tb() {\n+    if (enabled) {\n+      Throwable t = new Throwable();\n+      t.fillInStackTrace();\n+      StackTraceElement[] ste_arr = t.getStackTrace();\n+      for (int ii = 2; ii < ste_arr.length; ii++) {\n+        StackTraceElement ste = ste_arr[ii];\n+        System.out.printf(\"%s  %s%n\", indent_str, ste);\n+      }\n+    }\n+  }\n+\n+  /** Indents by one level. */\n+  public void indent() {\n+    if (enabled) {\n+      indent_str += INDENT_STR_ONE_LEVEL;\n+    }\n+  }\n+\n+  /** Clears indent. */\n+  public void clear() {","path":"src/main/java/org/plumelib/bcelutil/SimpleLog.java","position":81,"original_position":81,"commit_id":"de3dd5740beb47d1479827d1a73578ac06ac7857","original_commit_id":"de3dd5740beb47d1479827d1a73578ac06ac7857","user":{"login":"mernst","id":121025,"avatar_url":"https://avatars2.githubusercontent.com/u/121025?v=4","gravatar_id":"","url":"https://api.github.com/users/mernst","html_url":"https://github.com/mernst","followers_url":"https://api.github.com/users/mernst/followers","following_url":"https://api.github.com/users/mernst/following{/other_user}","gists_url":"https://api.github.com/users/mernst/gists{/gist_id}","starred_url":"https://api.github.com/users/mernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mernst/subscriptions","organizations_url":"https://api.github.com/users/mernst/orgs","repos_url":"https://api.github.com/users/mernst/repos","events_url":"https://api.github.com/users/mernst/events{/privacy}","received_events_url":"https://api.github.com/users/mernst/received_events","type":"User","site_admin":false},"body":"Surprising semantics for the method `clear`.  Why doesn't it mention the indent?","created_at":"2018-03-25T00:12:46Z","updated_at":"2018-03-25T00:15:08Z","html_url":"https://github.com/plume-lib/bcel-util/pull/3#discussion_r176923955","pull_request_url":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/plume-lib/bcel-util/pulls/comments/176923955"},"html":{"href":"https://github.com/plume-lib/bcel-util/pull/3#discussion_r176923955"},"pull_request":{"href":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3","id":176941264,"html_url":"https://github.com/plume-lib/bcel-util/pull/3","diff_url":"https://github.com/plume-lib/bcel-util/pull/3.diff","patch_url":"https://github.com/plume-lib/bcel-util/pull/3.patch","issue_url":"https://api.github.com/repos/plume-lib/bcel-util/issues/3","number":3,"state":"open","locked":false,"title":"enable simple logging","user":{"login":"markro49","id":10236459,"avatar_url":"https://avatars1.githubusercontent.com/u/10236459?v=4","gravatar_id":"","url":"https://api.github.com/users/markro49","html_url":"https://github.com/markro49","followers_url":"https://api.github.com/users/markro49/followers","following_url":"https://api.github.com/users/markro49/following{/other_user}","gists_url":"https://api.github.com/users/markro49/gists{/gist_id}","starred_url":"https://api.github.com/users/markro49/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markro49/subscriptions","organizations_url":"https://api.github.com/users/markro49/orgs","repos_url":"https://api.github.com/users/markro49/repos","events_url":"https://api.github.com/users/markro49/events{/privacy}","received_events_url":"https://api.github.com/users/markro49/received_events","type":"User","site_admin":false},"body":"went a little different way.  took your idea that we didn't need most of SimpleLog features and cut it to less than 100 lines.  There is a related branch/pull request in daikon.","created_at":"2018-03-22T23:59:40Z","updated_at":"2018-03-25T00:15:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3eb7ecfd970a358ebec8e2d40047082d70588c64","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3/commits","review_comments_url":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3/comments","review_comment_url":"https://api.github.com/repos/plume-lib/bcel-util/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plume-lib/bcel-util/issues/3/comments","statuses_url":"https://api.github.com/repos/plume-lib/bcel-util/statuses/de3dd5740beb47d1479827d1a73578ac06ac7857","head":{"label":"plume-lib:logging","ref":"logging","sha":"de3dd5740beb47d1479827d1a73578ac06ac7857","user":{"login":"plume-lib","id":20463401,"avatar_url":"https://avatars3.githubusercontent.com/u/20463401?v=4","gravatar_id":"","url":"https://api.github.com/users/plume-lib","html_url":"https://github.com/plume-lib","followers_url":"https://api.github.com/users/plume-lib/followers","following_url":"https://api.github.com/users/plume-lib/following{/other_user}","gists_url":"https://api.github.com/users/plume-lib/gists{/gist_id}","starred_url":"https://api.github.com/users/plume-lib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plume-lib/subscriptions","organizations_url":"https://api.github.com/users/plume-lib/orgs","repos_url":"https://api.github.com/users/plume-lib/repos","events_url":"https://api.github.com/users/plume-lib/events{/privacy}","received_events_url":"https://api.github.com/users/plume-lib/received_events","type":"Organization","site_admin":false},"repo":{"id":83939783,"name":"bcel-util","full_name":"plume-lib/bcel-util","owner":{"login":"plume-lib","id":20463401,"avatar_url":"https://avatars3.githubusercontent.com/u/20463401?v=4","gravatar_id":"","url":"https://api.github.com/users/plume-lib","html_url":"https://github.com/plume-lib","followers_url":"https://api.github.com/users/plume-lib/followers","following_url":"https://api.github.com/users/plume-lib/following{/other_user}","gists_url":"https://api.github.com/users/plume-lib/gists{/gist_id}","starred_url":"https://api.github.com/users/plume-lib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plume-lib/subscriptions","organizations_url":"https://api.github.com/users/plume-lib/orgs","repos_url":"https://api.github.com/users/plume-lib/repos","events_url":"https://api.github.com/users/plume-lib/events{/privacy}","received_events_url":"https://api.github.com/users/plume-lib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plume-lib/bcel-util","description":"Utility routines for working with the BCEL bytecode engineering library","fork":false,"url":"https://api.github.com/repos/plume-lib/bcel-util","forks_url":"https://api.github.com/repos/plume-lib/bcel-util/forks","keys_url":"https://api.github.com/repos/plume-lib/bcel-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plume-lib/bcel-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plume-lib/bcel-util/teams","hooks_url":"https://api.github.com/repos/plume-lib/bcel-util/hooks","issue_events_url":"https://api.github.com/repos/plume-lib/bcel-util/issues/events{/number}","events_url":"https://api.github.com/repos/plume-lib/bcel-util/events","assignees_url":"https://api.github.com/repos/plume-lib/bcel-util/assignees{/user}","branches_url":"https://api.github.com/repos/plume-lib/bcel-util/branches{/branch}","tags_url":"https://api.github.com/repos/plume-lib/bcel-util/tags","blobs_url":"https://api.github.com/repos/plume-lib/bcel-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plume-lib/bcel-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plume-lib/bcel-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/plume-lib/bcel-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plume-lib/bcel-util/statuses/{sha}","languages_url":"https://api.github.com/repos/plume-lib/bcel-util/languages","stargazers_url":"https://api.github.com/repos/plume-lib/bcel-util/stargazers","contributors_url":"https://api.github.com/repos/plume-lib/bcel-util/contributors","subscribers_url":"https://api.github.com/repos/plume-lib/bcel-util/subscribers","subscription_url":"https://api.github.com/repos/plume-lib/bcel-util/subscription","commits_url":"https://api.github.com/repos/plume-lib/bcel-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/plume-lib/bcel-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/plume-lib/bcel-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/plume-lib/bcel-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/plume-lib/bcel-util/contents/{+path}","compare_url":"https://api.github.com/repos/plume-lib/bcel-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plume-lib/bcel-util/merges","archive_url":"https://api.github.com/repos/plume-lib/bcel-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plume-lib/bcel-util/downloads","issues_url":"https://api.github.com/repos/plume-lib/bcel-util/issues{/number}","pulls_url":"https://api.github.com/repos/plume-lib/bcel-util/pulls{/number}","milestones_url":"https://api.github.com/repos/plume-lib/bcel-util/milestones{/number}","notifications_url":"https://api.github.com/repos/plume-lib/bcel-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plume-lib/bcel-util/labels{/name}","releases_url":"https://api.github.com/repos/plume-lib/bcel-util/releases{/id}","deployments_url":"https://api.github.com/repos/plume-lib/bcel-util/deployments","created_at":"2017-03-05T02:44:26Z","updated_at":"2017-03-06T05:26:44Z","pushed_at":"2018-03-22T23:59:41Z","git_url":"git://github.com/plume-lib/bcel-util.git","ssh_url":"git@github.com:plume-lib/bcel-util.git","clone_url":"https://github.com/plume-lib/bcel-util.git","svn_url":"https://github.com/plume-lib/bcel-util","homepage":null,"size":128,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"plume-lib:master","ref":"master","sha":"7ce5521c88c0568e333a444f6b2813f2d86e13ef","user":{"login":"plume-lib","id":20463401,"avatar_url":"https://avatars3.githubusercontent.com/u/20463401?v=4","gravatar_id":"","url":"https://api.github.com/users/plume-lib","html_url":"https://github.com/plume-lib","followers_url":"https://api.github.com/users/plume-lib/followers","following_url":"https://api.github.com/users/plume-lib/following{/other_user}","gists_url":"https://api.github.com/users/plume-lib/gists{/gist_id}","starred_url":"https://api.github.com/users/plume-lib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plume-lib/subscriptions","organizations_url":"https://api.github.com/users/plume-lib/orgs","repos_url":"https://api.github.com/users/plume-lib/repos","events_url":"https://api.github.com/users/plume-lib/events{/privacy}","received_events_url":"https://api.github.com/users/plume-lib/received_events","type":"Organization","site_admin":false},"repo":{"id":83939783,"name":"bcel-util","full_name":"plume-lib/bcel-util","owner":{"login":"plume-lib","id":20463401,"avatar_url":"https://avatars3.githubusercontent.com/u/20463401?v=4","gravatar_id":"","url":"https://api.github.com/users/plume-lib","html_url":"https://github.com/plume-lib","followers_url":"https://api.github.com/users/plume-lib/followers","following_url":"https://api.github.com/users/plume-lib/following{/other_user}","gists_url":"https://api.github.com/users/plume-lib/gists{/gist_id}","starred_url":"https://api.github.com/users/plume-lib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plume-lib/subscriptions","organizations_url":"https://api.github.com/users/plume-lib/orgs","repos_url":"https://api.github.com/users/plume-lib/repos","events_url":"https://api.github.com/users/plume-lib/events{/privacy}","received_events_url":"https://api.github.com/users/plume-lib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plume-lib/bcel-util","description":"Utility routines for working with the BCEL bytecode engineering library","fork":false,"url":"https://api.github.com/repos/plume-lib/bcel-util","forks_url":"https://api.github.com/repos/plume-lib/bcel-util/forks","keys_url":"https://api.github.com/repos/plume-lib/bcel-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plume-lib/bcel-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plume-lib/bcel-util/teams","hooks_url":"https://api.github.com/repos/plume-lib/bcel-util/hooks","issue_events_url":"https://api.github.com/repos/plume-lib/bcel-util/issues/events{/number}","events_url":"https://api.github.com/repos/plume-lib/bcel-util/events","assignees_url":"https://api.github.com/repos/plume-lib/bcel-util/assignees{/user}","branches_url":"https://api.github.com/repos/plume-lib/bcel-util/branches{/branch}","tags_url":"https://api.github.com/repos/plume-lib/bcel-util/tags","blobs_url":"https://api.github.com/repos/plume-lib/bcel-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plume-lib/bcel-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plume-lib/bcel-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/plume-lib/bcel-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plume-lib/bcel-util/statuses/{sha}","languages_url":"https://api.github.com/repos/plume-lib/bcel-util/languages","stargazers_url":"https://api.github.com/repos/plume-lib/bcel-util/stargazers","contributors_url":"https://api.github.com/repos/plume-lib/bcel-util/contributors","subscribers_url":"https://api.github.com/repos/plume-lib/bcel-util/subscribers","subscription_url":"https://api.github.com/repos/plume-lib/bcel-util/subscription","commits_url":"https://api.github.com/repos/plume-lib/bcel-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/plume-lib/bcel-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/plume-lib/bcel-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/plume-lib/bcel-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/plume-lib/bcel-util/contents/{+path}","compare_url":"https://api.github.com/repos/plume-lib/bcel-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plume-lib/bcel-util/merges","archive_url":"https://api.github.com/repos/plume-lib/bcel-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plume-lib/bcel-util/downloads","issues_url":"https://api.github.com/repos/plume-lib/bcel-util/issues{/number}","pulls_url":"https://api.github.com/repos/plume-lib/bcel-util/pulls{/number}","milestones_url":"https://api.github.com/repos/plume-lib/bcel-util/milestones{/number}","notifications_url":"https://api.github.com/repos/plume-lib/bcel-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plume-lib/bcel-util/labels{/name}","releases_url":"https://api.github.com/repos/plume-lib/bcel-util/releases{/id}","deployments_url":"https://api.github.com/repos/plume-lib/bcel-util/deployments","created_at":"2017-03-05T02:44:26Z","updated_at":"2017-03-06T05:26:44Z","pushed_at":"2018-03-22T23:59:41Z","git_url":"git://github.com/plume-lib/bcel-util.git","ssh_url":"git@github.com:plume-lib/bcel-util.git","clone_url":"https://github.com/plume-lib/bcel-util.git","svn_url":"https://github.com/plume-lib/bcel-util","homepage":null,"size":128,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3"},"html":{"href":"https://github.com/plume-lib/bcel-util/pull/3"},"issue":{"href":"https://api.github.com/repos/plume-lib/bcel-util/issues/3"},"comments":{"href":"https://api.github.com/repos/plume-lib/bcel-util/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/plume-lib/bcel-util/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plume-lib/bcel-util/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/plume-lib/bcel-util/statuses/de3dd5740beb47d1479827d1a73578ac06ac7857"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mernst"}}