mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-14 06:10:40 +01:00

This is a reland of21219a0e43
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 of59216ec4a4
> > 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}
31 lines
970 B
C++
31 lines
970 B
C++
/*
|
|
* 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"
|
|
|
|
namespace webrtc {
|
|
namespace jni {
|
|
|
|
JNI_FUNCTION_DECLARATION(void,
|
|
LoggableTest_nativeLogInfoTestMessage,
|
|
JNIEnv* jni,
|
|
jclass,
|
|
jstring j_message) {
|
|
std::string message =
|
|
JavaToNativeString(jni, JavaParamRef<jstring>(j_message));
|
|
RTC_LOG(LS_INFO) << message;
|
|
}
|
|
|
|
} // namespace jni
|
|
} // namespace webrtc
|