Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9378)

Unified Diff: chrome/test/kasko/py/kasko/json_logging_handler.py

Issue 2621363002: Remove Kasko! (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/kasko/py/kasko/integration_test.py ('k') | chrome/test/kasko/py/kasko/process.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/kasko/py/kasko/json_logging_handler.py
diff --git a/chrome/test/kasko/py/kasko/json_logging_handler.py b/chrome/test/kasko/py/kasko/json_logging_handler.py
deleted file mode 100755
index 8a26c38bc96f5501ebdf24b18788c57fc48a3d81..0000000000000000000000000000000000000000
--- a/chrome/test/kasko/py/kasko/json_logging_handler.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Logging handler used to log into a JSON file."""
-
-import json
-import logging
-
-
-class JSONLoggingHandler(logging.Handler):
- """A logging handler that forwards log messages into a JSON file."""
-
- def __init__(self, json_file):
- logging.Handler.__init__(self)
- formatter = logging.Formatter('%(name)s:%(message)s')
- self.setFormatter(formatter)
- self.json_file_ = json_file
- self.log_messages_ = []
-
- def close(self):
- """Dump the list of log messages into the JSON file."""
- with open(self.json_file_, 'w') as f:
- f.write(json.dumps(self.log_messages_))
- logging.Handler.close(self)
-
- def emit(self, record):
- """Append the record to list of messages."""
- self.log_messages_.append({record.levelname: self.format(record)})
« no previous file with comments | « chrome/test/kasko/py/kasko/integration_test.py ('k') | chrome/test/kasko/py/kasko/process.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698