summaryrefslogtreecommitdiff
path: root/src/base/str.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-12-03 01:22:38 -0800
committerGabe Black <gabeblack@google.com>2017-12-12 19:45:58 +0000
commit211124aff2c0750d1b80f0cd71fec3f06c50bcc6 (patch)
treecbd95fa69c55820f0b5ed6330b4411d1e4469d43 /src/base/str.cc
parenta51576e19c7f63930bc3b59c9a2e0a49cbc0bd81 (diff)
downloadgem5-211124aff2c0750d1b80f0cd71fec3f06c50bcc6.tar.xz
misc: Rework the logging functions.
Removed the "verbose" switch which wasn't used. Replaced the "get(LogLevel)" function with a get for each level. The parameter was always constant, so we can just call the right function at the right time. Made the "exit" behavior of panic/fatal a part of the logging implementation so that it can be overridden, and corrected a comment which said that both fatal and panic called ::abort(). Got rid of the printEpilogue function by reworking the print() methods. The subclasses of Logger can now override a "log" function which takes a composed message, letting the Logger class centralize how the message is put together and leaving the actual output mechanism to the subclass. Unfortunately there wasn't a way to tell gcc that the panic/fatal macros wouldn't return, so there needed to be an exit_helper wrapper function which calls the actual logger exit function. That can be marked as noreturn, unlike the virtual exit function. If the exit function does return, the wrapper will call ::abort(), placating gcc and ensuring that even if exit isn't implemented properly, exit_helper will still not return. That also provides a handy default implementation. Change-Id: I66d0cebd59f1127db980f3b565dbdf60687d8862 Reviewed-on: https://gem5-review.googlesource.com/6263 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/base/str.cc')
0 files changed, 0 insertions, 0 deletions