diff options
Diffstat (limited to 'base/trace.hh')
-rw-r--r-- | base/trace.hh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/base/trace.hh b/base/trace.hh index 1aadb36cf..5e05d6e5e 100644 --- a/base/trace.hh +++ b/base/trace.hh @@ -157,8 +157,16 @@ namespace Trace { extern const std::string DefaultName; }; -inline const std::string &name() { return Trace::DefaultName; } +// This silly little class allows us to wrap a string in a functor +// object so that we can give a name() that DPRINTF will like +struct StringWrap +{ + std::string str; + StringWrap(const std::string &s) : str(s) {} + const std::string &operator()() const { return str; } +}; +inline const std::string &name() { return Trace::DefaultName; } std::ostream &DebugOut(); // |