Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: base/logging.h

Issue 1352613004: Cleanup: Pass std::string as const reference from ash/ + minor coding style changes in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove const qualifier for int in function arguments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/test/test_session_state_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_LOGGING_H_ 5 #ifndef BASE_LOGGING_H_
6 #define BASE_LOGGING_H_ 6 #define BASE_LOGGING_H_
7 7
8 #include <cassert> 8 #include <cassert>
9 #include <string> 9 #include <string>
10 #include <cstring> 10 #include <cstring>
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 }; 799 };
800 800
801 SaveLastError last_error_; 801 SaveLastError last_error_;
802 #endif 802 #endif
803 803
804 DISALLOW_COPY_AND_ASSIGN(LogMessage); 804 DISALLOW_COPY_AND_ASSIGN(LogMessage);
805 }; 805 };
806 806
807 // A non-macro interface to the log facility; (useful 807 // A non-macro interface to the log facility; (useful
808 // when the logging level is not a compile-time constant). 808 // when the logging level is not a compile-time constant).
809 inline void LogAtLevel(int const log_level, std::string const &msg) { 809 inline void LogAtLevel(int log_level, const std::string& msg) {
810 LogMessage(__FILE__, __LINE__, log_level).stream() << msg; 810 LogMessage(__FILE__, __LINE__, log_level).stream() << msg;
811 } 811 }
812 812
813 // This class is used to explicitly ignore values in the conditional 813 // This class is used to explicitly ignore values in the conditional
814 // logging macros. This avoids compiler warnings like "value computed 814 // logging macros. This avoids compiler warnings like "value computed
815 // is not used" and "statement has no effect". 815 // is not used" and "statement has no effect".
816 class LogMessageVoidify { 816 class LogMessageVoidify {
817 public: 817 public:
818 LogMessageVoidify() { } 818 LogMessageVoidify() { }
819 // This has to be an operator with a precedence lower than << but 819 // This has to be an operator with a precedence lower than << but
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 #elif NOTIMPLEMENTED_POLICY == 5 964 #elif NOTIMPLEMENTED_POLICY == 5
965 #define NOTIMPLEMENTED() do {\ 965 #define NOTIMPLEMENTED() do {\
966 static bool logged_once = false;\ 966 static bool logged_once = false;\
967 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 967 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
968 logged_once = true;\ 968 logged_once = true;\
969 } while(0);\ 969 } while(0);\
970 EAT_STREAM_PARAMETERS 970 EAT_STREAM_PARAMETERS
971 #endif 971 #endif
972 972
973 #endif // BASE_LOGGING_H_ 973 #endif // BASE_LOGGING_H_
OLDNEW
« no previous file with comments | « ash/test/test_session_state_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698