1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """ Error and information logging for IDL """
11 """Captures and routes logging output.
13 Caputres logging output and/or sends out via a file handle, typically
16 def __init__(self
, name
, out
):
18 self
._name
= '%s : ' % name
34 def LogLine(self
, filename
, lineno
, pos
, msg
):
36 line
= "%s(%d) : %s%s\n" % (filename
, lineno
, self
._name
, msg
)
41 def SetConsole(self
, enable
):
42 self
._console
= enable
44 def SetCapture(self
, enable
):
45 self
._capture
= enable
52 ErrOut
= IDLLog('Error', sys
.stderr
)
53 WarnOut
= IDLLog('Warning', sys
.stdout
)
54 InfoOut
= IDLLog('', sys
.stdout
)