Daniel Carvalho has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/42141 )

Change subject: base: Add LOC to Loggers
......................................................................

base: Add LOC to Loggers

Printing the line and the file that triggered a log
is useful for debugging.

Change-Id: I74e0637b2943049134bd3e9a4bc6cab3766591a9
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42141
Reviewed-by: Giacomo Travaglini <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/base/logging.hh
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/logging.hh b/src/base/logging.hh
index 4ef700a..9d0c478 100644
--- a/src/base/logging.hh
+++ b/src/base/logging.hh
@@ -123,7 +123,12 @@
     bool enabled;

     /** Generates the log message. By default it is sent to cerr. */
-    virtual void log(const Loc &loc, std::string s) { std::cerr << s; }
+    virtual void
+    log(const Loc &loc, std::string s)
+    {
+        std::cerr << loc.file << ":" << loc.line << ": " << s;
+    }
+
     virtual void exit() { /* Fall through to the abort in exit_helper. */ }

     const char *prefix;



4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/42141
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I74e0637b2943049134bd3e9a4bc6cab3766591a9
Gerrit-Change-Number: 42141
Gerrit-PatchSet: 6
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to