Add GN arg to force RTC_DLOG to be ON.

Bug: None
Change-Id: I7f5e80c015157718bb3f1d192b0c14f09f9bf3bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234840
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35184}
diff --git a/BUILD.gn b/BUILD.gn
index 6e7cd5d..215c74c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -118,6 +118,10 @@
   cflags = []
   ldflags = []
 
+  if (rtc_dlog_always_on) {
+    defines += [ "DLOG_ALWAYS_ON" ]
+  }
+
   if (rtc_enable_symbol_export || is_component_build) {
     defines += [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ]
   }
diff --git a/webrtc.gni b/webrtc.gni
index 90f69f0..c985606 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -45,6 +45,11 @@
 }
 
 declare_args() {
+  # Setting this to trye, will make RTC_DLOG() expand to log statements instead
+  # of being removed by the preprocessor.
+  # This is useful for example to be able to get RTC_DLOGs on a release build.
+  rtc_dlog_always_on = false
+
   # Setting this to true will make RTC_OBJC_EXPORT expand to code that will
   # manage symbols visibility. By default, Obj-C/Obj-C++ symbols are exported
   # if C++ symbols are but setting this arg to true while keeping