| # Copyright 2012 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| """ Error and information logging for IDL """ |
| """Captures and routes logging output. |
| Caputres logging output and/or sends out via a file handle, typically |
| def __init__(self, name, out): |
| self._name = '%s : ' % name |
| def LogLine(self, filename, lineno, pos, msg): |
| line = "%s(%d) : %s%s\n" % (filename, lineno, self._name, msg) |
| def SetConsole(self, enable): |
| def SetCapture(self, enable): |
| ErrOut = IDLLog('Error', sys.stderr) |
| WarnOut = IDLLog('Warning', sys.stdout) |
| InfoOut = IDLLog('', sys.stdout) |