Similar to earlier CL https://webrtc-review.googlesource.com/c/src/+/169683. While this is a rather specific use case and solution, currently these macros are using a mix of styles ever since https://webrtc-review.googlesource.com/c/src/+/184934. By switching to ::rtc we can ensure that the right namespace is used.
Bug: webrtc:11400
Change-Id: Id06f09b5224a399bd6b43bf0237422b24b5adfb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/312980
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40490}
The goal of this CL is to create a new LogSink::OnLogMessage API which
propagates the source location of the log to the log sinks.
Bug: b/238157120
Change-Id: I5a12bf80fd9c5569ed7aa1ef9185eee58830b19f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269249
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37672}
See https://webrtc-review.googlesource.com/c/src/+/269180.
A default ctor was left behind in the version without logs enabled.
Bug: None
Change-Id: I27826928fe702c1d50f6ed823def9f5f0bb9aee8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269248
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37594}
This ctor has been deprecated for a while and it should be unused
by WebRTC clients.
Bug: None
Change-Id: I7d33ae24eefafe48924011f55fb53150b717d593
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269180
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37584}
Types with ToLogString implemented were not being recognized correctly.
Now types like TimeDelta and Timestamp can be logged as normal.
Change-Id: Ia15f90bdd1d63a39f7452f9b4bba178d01b74352
Bug: webrtc:13995
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259863
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36646}
This is part of a large scale effort to increase adoption of
absl::string_view across the WebRTC code base.
This CL adds absl::string_view versions of the OnLogMessage functions in
rtc::LogSink. The const std::string& versions are kept for now since
downstream clients use subclasses of LogSink and need to be migrated
before these are removed.
Bug: webrtc:13579
Change-Id: I57bb72ad503805ff0ca16f1d7aece2d44c65cb73
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253980
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Owners-Override: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36189}
The nonstandard loglevel equivalents have been removed, but I forgot
to update this comment.
Bug: webrtc:13362
Change-Id: Ifd604cfe53b9ee312d80179cc5e1bc6734ee6c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254261
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36158}
These have been depreated since November 2021.
Bug: webrtc:13362
Change-Id: Ifc1b984ab54faefc974006f37f909e6927aed056
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251760
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36023}
This remove webrtc-specific macro that has no reason to be webrtc specific
ABSL_DEPRECATED takes a message parameter encouraging to write text how class or function is deprecated.
Bug: webrtc:12484
Change-Id: I89f1398f91dacadc37f7db469dcd985e3724e444
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208282
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33314}
https://webrtc-review.googlesource.com/c/src/+/184922 removed the
check for whether we should actually emit a given log message or not
from the main logging function, and attempted to put it around each
call site instead, so that we could check first and avoid computing
log arguments if the check says no.
However, it missed these two places.
Bug: webrtc:11968
Change-Id: I1a0d68888d1a2c9814bc02fe9db49d7084bad8fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185004
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32162}
When the logging severity is statically known, passing it as a
template argument instead of as a function argument saves space at the
call site. libjingle_peerconnection_so.so shrinks by 5 kB for arm32 and
9.5 kB for arm64.
This is a repeat of the trick added in
https://webrtc-review.googlesource.com/c/src/+/74480/, which was
subsequently lost.
Bug: webrtc:11968
Change-Id: Ib6659d195d796b93e72b91d3d7c6b6e990aceb77
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184934
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32157}
The IsNoop() function already knows whether logging is off, and is
inlined precisely in the cases where it is statically switched off. So
this source change results in no binary change.
When I compile this locally for arm64 (Android, opt build) I get
identical md5 sums for libjingle_peerconnection_so.so before and after
this CL.
Bug: webrtc:11968
Change-Id: I4db9a3e1a1a84eea7825dad7720df742a6ec9255
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184933
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32156}
It makes very little difference, but will allow a slightly nontrivial
sequel CL [https://webrtc-review.googlesource.com/c/src/+/184933] to
cause no binary changes at all.
Bug: webrtc:11968
Change-Id: I681ea2de757b46fe2f08df6e99cf974e577542c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32155}
This does mean that each call site becomes slightly more expensive
in terms of binary size, but until we have a better way to mitigate
the perf impact, I think we'll have to live with it.
We could also consider migrating LS_VERBOSE over to RTC_DLOG.
Bug: webrtc:11968
Change-Id: Ib16f1109366ffaa88b8df28ebfa5bc3b539f691f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184922
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32153}
Adding :: before rtc allow us to use the macro in nested rtc namespace for external components like
namespace xxxxxxx {
namespace rtc {
RTC_CHECK(true);
}
}
Bug: webrtc:11400
Change-Id: I79349b847c3fce8197c82aec31b672a1a16e5388
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169683
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30684}
LogMessage::streams_ is a global and thus should have trivial destructor
Bug: None
Change-Id: Ie6a8029602f50b2bc5bab546ffc0365ef0954024
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157042
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29552}
This is a reland of: https://webrtc-review.googlesource.com/c/src/+/128202
Logging unit test has been fixed to unregister the log listener.
Bug: webrtc:10418
Change-Id: Idac9cb71807e16a585ccb7e3e4271aa45d69f547
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128541
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27192}
This reverts commit 6b6f537e83.
Reason for revert: AddressSanitizer: stack-use-after-return third_party/webrtc/files/stable/webrtc/rtc_base/logging.cc:214:17 in rtc::LogMessage::~LogMessage()
Original change's description:
> Adding support for enum class in RTC_CHECK and RTC_LOG.
>
> Enum class types are by design not convertible to arithmetic types.
> As a result they are currently not supported in RTC_CHECK and RTC_LOG.
> The current workaround was to use something like RTC_CHECK(v1 == v2)
> instead of RTC_CHECK_EQ(v1, v2).
> This change adds support for any enum class type by converting it to the
> underlying type.
>
> Bug: webrtc:10418
> Change-Id: I59e6608e6a97a4cc007c903f8e021a58d4c49ff8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128202
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27166}
TBR=kwiberg@webrtc.org,amithi@webrtc.org
Change-Id: I515087dbbebd6bf8cbebd8f9944fd61a20f758db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10418
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128540
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27168}
Enum class types are by design not convertible to arithmetic types.
As a result they are currently not supported in RTC_CHECK and RTC_LOG.
The current workaround was to use something like RTC_CHECK(v1 == v2)
instead of RTC_CHECK_EQ(v1, v2).
This change adds support for any enum class type by converting it to the
underlying type.
Bug: webrtc:10418
Change-Id: I59e6608e6a97a4cc007c903f8e021a58d4c49ff8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128202
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27166}
Our macros always pass __FILE__ and __LINE__ as parameters, so the impact was limited. However, doing the correct thing is obviously preferable to doing the wrong thing, so let's fix it.
Bug: webrtc:10003
Change-Id: Id2529c4bd8c7e90a8f0ac3ffa713dbe305ba66d8
Reviewed-on: https://webrtc-review.googlesource.com/c/111244
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25712}
This CL removes the need of having rtc_base:rtc_base_approved_generic
and rtc_base:rtc_base_approved_objc since it removes the _objc build
target by moving the declaration of rtc::DescriptionFromOSStatus into
rtc_base/logging_mac.h in order to have a new target
rtc_base:logging_mac on which rtc_base:logging can depend on.
The target rtc_base:rtc_base_approved_generic will be removed in a
follow up CL.
Bug: webrtc:9838
Change-Id: Id93ac7bced213128e7d654694ff15337c26dab62
Reviewed-on: https://webrtc-review.googlesource.com/c/104802
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25085}
Currently we check if a message should be printed at the call site using LogMessage::Loggable, in the LogMessage itself using LogMessage::IsNoop and in LogMessage::OutputToDebug using log_to_stderr_.
This change unifies the first two of these into a early return in Log().
Bug: webrtc:8982
Change-Id: I462b1cf63c44fec46e5c59b147b2b99605aaae0c
Reviewed-on: https://webrtc-review.googlesource.com/98820
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24630}
This enables us to migrate a internal project from depending on implementation
details of our LOG macros.
Bug: webrtc:9278
Change-Id: I41408aec40e26d2b55df58360f94f5ceaa57af4e
Reviewed-on: https://webrtc-review.googlesource.com/98001
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24597}