summaryrefslogtreecommitdiff
path: root/src/base/logging.cc
AgeCommit message (Collapse)Author
2017-12-12misc: Rework the logging functions.Gabe Black
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>
2017-12-04misc: Rename misc.(hh|cc) to logging.(hh|cc)Gabe Black
These files aren't a collection of miscellaneous stuff, they're the definition of the Logger interface, and a few utility macros for calling into that interface (panic, warn, etc.). Change-Id: I84267ac3f45896a83c0ef027f8f19c5e9a5667d1 Reviewed-on: https://gem5-review.googlesource.com/6226 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Gabe Black <gabeblack@google.com>