)]}'
{
  "commit": "84fbdc97b06776c133b8aed9c8ecc2222675c73c",
  "tree": "b6655a309323c9cb977401189cd66f01e0d84380",
  "parents": [
    "6e4312545b9d52655d15b9beb6a95d00b8a637ca"
  ],
  "author": {
    "name": "Eric Biggers",
    "email": "ebiggers@google.com",
    "time": "Fri Feb 10 17:27:48 2023 +0000"
  },
  "committer": {
    "name": "Eric Biggers",
    "email": "ebiggers@google.com",
    "time": "Thu Feb 16 03:18:13 2023 +0000"
  },
  "message": "Fix Slogf to behave like Slog\n\nLog, Slog, and Slogf without format arguments all log VERBOSE and above\nby default.  In contrast, Slogf with format arguments only logs INFO and\nabove by default.  That\u0027s very surprising, and it\u0027s causing messages to\ndisappear from the log after \"trivial\" conversions to Slogf.\n\nThis is caused by Slogf assuming that Log.isLoggable() works in the\nexpected way.  Unfortunately, Log.isLoggable() has always been advisory\nin Android, not enforced.  By default it only returns true for INFO and\nabove, but it\u0027s always been up to the users of the logging methods to\ncheck it, if they want to.  system_server generally does not check it,\nor only uses it for boolean knobs at the class level that selected log\nmessages are conditional on.  system_server also lots quite a bit at\nDEBUG level; people would probably be unhappy if it started enforcing\nLog.isLoggable() and all DEBUG messages disappeared from the logs.\n\nThe end result is that while making logging methods return early if\n!Log.isLoggable() at first seems like a perfectly reasonable thing to\ndo, in the context of system_server it actually results in unexpected\nbehavior, so it shouldn\u0027t be done.  It\u0027s up to the callers to decide\nwhat they want to log.\n\nBug: 182476140\nBug: 268526331\nTest: atest FrameworksMockingServicesTests:SlogfTest\nChange-Id: If8d2ffe5bda51add08e2c952871e0c646ebb2474\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b0dfb8467fa767178153d2851114143e2e64d7f4",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/cpu/CpuMonitorService.java",
      "new_id": "4eefe5c8cad5c6ebdb8aeef6bd7474c64f10d162",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/cpu/CpuMonitorService.java"
    },
    {
      "type": "modify",
      "old_id": "6efbd89daf4c0e6ead446635be2810c476cd15ad",
      "old_mode": 33188,
      "old_path": "services/core/java/com/android/server/utils/Slogf.java",
      "new_id": "a4b2bfb3a77148e5a3d072295bea33a9b32ee606",
      "new_mode": 33188,
      "new_path": "services/core/java/com/android/server/utils/Slogf.java"
    },
    {
      "type": "modify",
      "old_id": "cb59d37e46ecf8cb2b644bec066d5a2ae36b4212",
      "old_mode": 33188,
      "old_path": "services/tests/mockingservicestests/src/com/android/server/utils/SlogfTest.java",
      "new_id": "02e46bb2ed392cb050897453bcae0e82affce17e",
      "new_mode": 33188,
      "new_path": "services/tests/mockingservicestests/src/com/android/server/utils/SlogfTest.java"
    }
  ]
}
