gem5/src/python/swig
Andreas Sandberg 60b26f1546 base: Refactor logging to make log level selection cleaner
It's currently possible to change the log level in gem5 by tweaking a
set of global variables. These variables are currently exposed to
Python using SWIG. This mechanism is far from ideal for two reasons:
First, changing the log level requires that the Python world enables
or disables individual levels. Ideally, this should be a single call
where a log level is selected. Second, exporting global variables is
poorly supported by most Python frameworks. SWIG puts variables in
their own namespace and PyBind doesn't seem to support it at all.

This changeset refactors the logging code to create a more abstract
interface. Each log level is associated with an instance of a Logger
class. This class contains common functionality, an enable flag, and a
verbose flag.

Available LogLevels are described by the LogLevel class. Lower log
levels are used for more critical messages (PANIC being level 0) and
higher levels for less critical messages. The highest log level that
is printed is controlled by calling Logger:setLevel().

Change-Id: I31e44299d242d953197a8e62679250c91d6ef776
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2017-02-27 11:25:01 +00:00
..
core.i base: Refactor logging to make log level selection cleaner 2017-02-27 11:25:01 +00:00
debug.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
drain.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
event.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
inet.i includes: sort all includes 2011-04-15 10:44:06 -07:00
pyevent.cc style: Force Python.h to be included before main header 2017-02-07 15:28:33 +00:00
pyevent.hh misc: Add Python.h header to pyevents.hh 2017-02-10 10:00:18 -05:00
pyobject.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
pyobject.hh dev: Move network devices to src/dev/net/ 2015-12-10 10:35:18 +00:00
pyobject.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
range.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
serialize.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
stats.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00
time.i Major changes to how SimObjects are created and initialized. Almost all 2007-07-23 21:51:38 -07:00
trace.i python: Move native wrappers to the _m5 namespace 2017-01-27 12:40:01 +00:00