Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.0 KiB
C++
Raw Normal View History

Reland "Reland "Injectable logging"" This is a reland of 21219a0e43446701810236fb9fdd59be072c12df The default implementation of OnLogMessage(msg, sev, tag) discarded the tag, resulting in FileRotatingLogSink not receiving tags. Since the revert the default implementation of OnLogMessage(msg, sev, tag) has been updated to add the tag to the log message. A more efficient implementation of it has also been added for FileRotatingLogSink. Unit tests are added for the default implementation and for Loggable injection. Original change's description: > Reland "Injectable logging" > > Any injected loggable or NativeLogger would be deleted if PCFactory > was reinitialized without calling setInjectableLogger. Now native > logging is not implemented as a Loggable, so it will remain active > unless a Loggable is injected. > > This is a reland of 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f > > Original change's description: > > Injectable logging > > > > Allows passing a Loggable to PCFactory.initializationOptions, which > > is then injected to Logging.java and logging.h. Future log messages > > in both Java and native will then be passed to this Loggable. > > > > Bug: webrtc:9225 > > Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967 > > Reviewed-on: https://webrtc-review.googlesource.com/73243 > > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#23241} > > Bug: webrtc:9225 > Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee > TBR: kwiberg > Reviewed-on: https://webrtc-review.googlesource.com/77140 > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23310} Bug: webrtc:9225 Change-Id: I67a5728fe772f0bedc9509713ed8b8ffdc31af81 TBR: kwiberg Reviewed-on: https://webrtc-review.googlesource.com/80860 Commit-Queue: Paulina Hensman <phensman@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23711}
2018-06-21 14:31:38 +02:00
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <memory>
#include "rtc_base/logging.h"
#include "sdk/android/native_api/jni/java_types.h"
#include "sdk/android/src/jni/jni_helpers.h"
Reland "Remove jni_zero type aliases in jni_generator_helper.h." This is a reland of commit 6cb7b3a424455f82ad5df78a7295a3e5253b1445 Original change's description: > Reland "Remove jni_zero type aliases in jni_generator_helper.h." > > This is a reland of commit 9fcaa034bc032da9de5d6fcdd45528169f44d343 > > Original change's description: > > Remove jni_zero type aliases in jni_generator_helper.h. > > > > This CL removes some type alias from > > sdk/android/src/jni/jni_generator_helper.h and make sure all the > > jni_zero types are referred to using the jni_zero:: namespace. > > > > The goal is to remove sdk/android/src/jni/jni_generator_helper.h > > in future CLs. > > > > Bug: b/319078685, b/351773023 > > Change-Id: Ief60fce3e8f301f09ac5392d143aa5a82a445bcb > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356882 > > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > > Reviewed-by: Jeremy Leconte <jleconte@google.com> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#42618} > > No-Presubmit: True > Bug: b/319078685, b/351773023 > Change-Id: I605a726788ee84efdbdc9e75098b404cbd7c1f30 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358922 > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#42751} No-Presubmit: True Bug: b/319078685, b/351773023 Change-Id: I8294d8c5c49bc330d8158684a60fd4e6c88627d8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359320 Reviewed-by: Zoé Lepaul <xalep@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mohamed Heikal <mheikal@google.com> Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42768}
2024-08-09 09:35:11 +00:00
#include "third_party/jni_zero/jni_zero.h"
Reland "Reland "Injectable logging"" This is a reland of 21219a0e43446701810236fb9fdd59be072c12df The default implementation of OnLogMessage(msg, sev, tag) discarded the tag, resulting in FileRotatingLogSink not receiving tags. Since the revert the default implementation of OnLogMessage(msg, sev, tag) has been updated to add the tag to the log message. A more efficient implementation of it has also been added for FileRotatingLogSink. Unit tests are added for the default implementation and for Loggable injection. Original change's description: > Reland "Injectable logging" > > Any injected loggable or NativeLogger would be deleted if PCFactory > was reinitialized without calling setInjectableLogger. Now native > logging is not implemented as a Loggable, so it will remain active > unless a Loggable is injected. > > This is a reland of 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f > > Original change's description: > > Injectable logging > > > > Allows passing a Loggable to PCFactory.initializationOptions, which > > is then injected to Logging.java and logging.h. Future log messages > > in both Java and native will then be passed to this Loggable. > > > > Bug: webrtc:9225 > > Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967 > > Reviewed-on: https://webrtc-review.googlesource.com/73243 > > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#23241} > > Bug: webrtc:9225 > Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee > TBR: kwiberg > Reviewed-on: https://webrtc-review.googlesource.com/77140 > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23310} Bug: webrtc:9225 Change-Id: I67a5728fe772f0bedc9509713ed8b8ffdc31af81 TBR: kwiberg Reviewed-on: https://webrtc-review.googlesource.com/80860 Commit-Queue: Paulina Hensman <phensman@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23711}
2018-06-21 14:31:38 +02:00
namespace webrtc {
namespace jni {
JNI_FUNCTION_DECLARATION(void,
LoggableTest_nativeLogInfoTestMessage,
JNIEnv* jni,
jclass,
jstring j_message) {
std::string message =
Reland "Remove jni_zero type aliases in jni_generator_helper.h." This is a reland of commit 6cb7b3a424455f82ad5df78a7295a3e5253b1445 Original change's description: > Reland "Remove jni_zero type aliases in jni_generator_helper.h." > > This is a reland of commit 9fcaa034bc032da9de5d6fcdd45528169f44d343 > > Original change's description: > > Remove jni_zero type aliases in jni_generator_helper.h. > > > > This CL removes some type alias from > > sdk/android/src/jni/jni_generator_helper.h and make sure all the > > jni_zero types are referred to using the jni_zero:: namespace. > > > > The goal is to remove sdk/android/src/jni/jni_generator_helper.h > > in future CLs. > > > > Bug: b/319078685, b/351773023 > > Change-Id: Ief60fce3e8f301f09ac5392d143aa5a82a445bcb > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356882 > > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > > Reviewed-by: Jeremy Leconte <jleconte@google.com> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#42618} > > No-Presubmit: True > Bug: b/319078685, b/351773023 > Change-Id: I605a726788ee84efdbdc9e75098b404cbd7c1f30 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358922 > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#42751} No-Presubmit: True Bug: b/319078685, b/351773023 Change-Id: I8294d8c5c49bc330d8158684a60fd4e6c88627d8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359320 Reviewed-by: Zoé Lepaul <xalep@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mohamed Heikal <mheikal@google.com> Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42768}
2024-08-09 09:35:11 +00:00
JavaToNativeString(jni, jni_zero::JavaParamRef<jstring>(jni, j_message));
Reland "Reland "Injectable logging"" This is a reland of 21219a0e43446701810236fb9fdd59be072c12df The default implementation of OnLogMessage(msg, sev, tag) discarded the tag, resulting in FileRotatingLogSink not receiving tags. Since the revert the default implementation of OnLogMessage(msg, sev, tag) has been updated to add the tag to the log message. A more efficient implementation of it has also been added for FileRotatingLogSink. Unit tests are added for the default implementation and for Loggable injection. Original change's description: > Reland "Injectable logging" > > Any injected loggable or NativeLogger would be deleted if PCFactory > was reinitialized without calling setInjectableLogger. Now native > logging is not implemented as a Loggable, so it will remain active > unless a Loggable is injected. > > This is a reland of 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f > > Original change's description: > > Injectable logging > > > > Allows passing a Loggable to PCFactory.initializationOptions, which > > is then injected to Logging.java and logging.h. Future log messages > > in both Java and native will then be passed to this Loggable. > > > > Bug: webrtc:9225 > > Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967 > > Reviewed-on: https://webrtc-review.googlesource.com/73243 > > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#23241} > > Bug: webrtc:9225 > Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee > TBR: kwiberg > Reviewed-on: https://webrtc-review.googlesource.com/77140 > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23310} Bug: webrtc:9225 Change-Id: I67a5728fe772f0bedc9509713ed8b8ffdc31af81 TBR: kwiberg Reviewed-on: https://webrtc-review.googlesource.com/80860 Commit-Queue: Paulina Hensman <phensman@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23711}
2018-06-21 14:31:38 +02:00
RTC_LOG(LS_INFO) << message;
}
} // namespace jni
} // namespace webrtc