4Copyright (c) 2011-2016 ARM Limited
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12Unless required by applicable law or agreed to
in writing, software
13distributed under the License
is distributed on an
"AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.
15See the License
for the specific language governing permissions
and
16limitations under the License.
22from functools import partial
25class HtrunLogger(object):
26 """! Yet another logger flavour """
28 logging.basicConfig(stream=sys.stdout,format=
'[%(created).2f][%(name)s]%(message)s', level=logging.DEBUG)
29 self.
logger = logging.getLogger(name)
32 def __prn_log(self, logger_level, text, timestamp=None):
34 'logger_level' : logger_level,
38 self.
prn_dbg = partial(__prn_log, self,
'DBG')
39 self.
prn_wrn = partial(__prn_log, self,
'WRN')
40 self.
prn_err = partial(__prn_log, self,
'ERR')
41 self.
prn_inf = partial(__prn_log, self,
'INF')
42 self.
prn_txt = partial(__prn_log, self,
'TXT')
43 self.
prn_txd = partial(__prn_log, self,
'TXD')
44 self.
prn_rxd = partial(__prn_log, self,
'RXD')