gem5/src/base
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
..
loader base: fix small memory leak in the ELF loader 2017-02-23 13:27:38 -05:00
stats style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
vnc style: [patch 3/22] reduce include dependencies in some headers 2016-11-09 14:27:40 -06:00
addr_range.hh base: Allow multiple interleaved ranges 2015-05-26 03:21:40 -04:00
addr_range_map.hh mem: Add interleaving bits to the address ranges 2013-01-07 13:05:38 -05:00
atomicio.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
atomicio.hh style: fix missing spaces in control statements 2016-02-06 17:21:19 -08:00
barrier.hh sim: simulate with multiple threads and event queues 2013-11-25 11:21:00 -06:00
bigint.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
bigint.hh misc: Another round of static analysis fixups 2014-11-24 09:03:38 -05:00
bitfield.hh style: [patch 3/22] reduce include dependencies in some headers 2016-11-09 14:27:40 -06:00
bitmap.cc base: Redesign internal frame buffer handling 2015-05-23 13:37:03 +01:00
bitmap.hh base: Redesign internal frame buffer handling 2015-05-23 13:37:03 +01:00
bitunion.hh style: [patch 3/22] reduce include dependencies in some headers 2016-11-09 14:27:40 -06:00
callback.cc gcc: Clean-up of non-C++0x compliant code, first steps 2012-03-19 06:36:09 -04:00
callback.hh callback: Make helper functions that create callback objects for you 2010-04-18 13:23:25 -07:00
cast.hh safe_cast: add a new cast function for casts that should always succeed. 2008-11-10 11:51:17 -08:00
chunk_generator.hh base: add new ChunkGenerator method to identify last chunk 2015-04-22 07:51:27 -07:00
circlebuf.hh dev: Fix incorrect terminal backlog handling 2016-04-27 15:33:58 +01:00
compiler.hh misc: Remove redundant compiler-specific defines 2015-10-12 04:07:59 -04:00
condcodes.hh Condition Codes: Fix the findParity function. 2007-09-25 20:26:10 -07:00
cp_annotate.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
cp_annotate.hh style: remove trailing whitespace 2016-02-06 17:21:18 -08:00
CPA.py sim: Include object header files in SWIG interfaces 2012-11-02 11:32:01 -05:00
cprintf.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
cprintf.hh style: remove trailing whitespace 2016-02-06 17:21:18 -08:00
cprintf_formats.hh misc: Restore ostream flags where needed 2014-09-19 10:35:09 -04:00
date.cc Updated Authors from bk prs info 2006-05-31 19:26:56 -04:00
debug.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
debug.hh base: remove Trace::enabled flag 2015-09-30 15:21:55 -05:00
fenv.c style: fix missing spaces in control statements 2016-02-06 17:21:19 -08:00
fenv.hh create base/fenv.c to standerdize fenv across platforms. It's a c file and not a cpp file because c99 2007-04-21 17:50:47 -04:00
flags.hh style: remove trailing whitespace 2016-02-06 17:21:18 -08:00
framebuffer.cc base: Add serialization support to Pixels and FrameBuffer 2015-07-07 09:51:04 +01:00
framebuffer.hh misc: Remove redundant compiler-specific defines 2015-10-12 04:07:59 -04:00
hostinfo.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
hostinfo.hh scons: Add warning for missing declarations 2013-02-19 05:56:07 -05:00
inet.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
inet.hh style: remove trailing whitespace 2016-02-06 17:21:18 -08:00
inifile.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
inifile.hh sim: Add a checkpoint function to test for entries 2016-10-04 11:22:16 +01:00
intmath.cc Updated Authors from bk prs info 2006-05-31 19:26:56 -04:00
intmath.hh base: Add const to intmath and be more flexible with typing 2014-08-26 10:14:32 -04:00
match.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
match.hh Updated Authors from bk prs info 2006-05-31 19:26:56 -04:00
misc.cc base: Refactor logging to make log level selection cleaner 2017-02-27 11:25:01 +00:00
misc.hh base: Refactor logging to make log level selection cleaner 2017-02-27 11:25:01 +00:00
output.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
output.hh base: Add support for changing output directories 2015-11-27 14:41:59 +00:00
pollevent.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
pollevent.hh misc: Remove redundant compiler-specific defines 2015-10-12 04:07:59 -04:00
printable.hh Additional comments and helper functions for PrintReq. 2008-01-02 13:46:22 -08:00
random.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
random.hh misc: Remove redundant compiler-specific defines 2015-10-12 04:07:59 -04:00
refcnt.hh refcnt: Update doxygen comments 2011-04-13 09:32:19 -07:00
remote_gdb.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
remote_gdb.hh arm: remote GDB: rationalize structure of register offsets 2015-12-18 15:12:07 -06:00
SConscript base: Rewrite the CircleBuf to fix bugs and add serialization 2015-08-07 09:59:19 +01:00
socket.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
socket.hh sockets: Add a function to disable all listening sockets. 2008-08-03 18:19:55 -07:00
statistics.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
statistics.hh mem, stats: fix typos in CommMonitor and Stats 2017-02-15 14:59:06 -06:00
stl_helpers.hh clang: Enable compiling gem5 using clang 2.9 and 3.0 2012-01-31 12:05:52 -05:00
str.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
str.hh base: Clean up redundant string functions and use C++11 2014-09-20 17:17:49 -04:00
time.cc style: [patch 3/22] reduce include dependencies in some headers 2016-11-09 14:27:40 -06:00
time.hh sim: Refactor the serialization base class 2015-07-07 09:51:03 +01:00
trace.cc style: [patch 1/22] use /r/3648/ to reorganize includes 2016-11-09 14:27:37 -06:00
trace.hh misc: Remove redundant compiler-specific defines 2015-10-12 04:07:59 -04:00
trie.hh base: Include cassert in trie.hh. 2012-04-22 05:20:44 -07:00
types.cc ruby: replace Time with Cycles in Message class 2013-02-10 21:26:24 -06:00
types.hh * * * 2016-01-19 13:57:50 -05:00