Skip to content

Commit b0f3948

Browse files
authored
Revertglog (#38)
* Revert "Updating glog version to latest(0.3.5) which is the version RN is using now (#32)" This reverts commit 4bfaca4. * Revert "Adding logging support on droid and logging failure message (#31)" This reverts commit 7fd45d0.
1 parent f1c603e commit b0f3948

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3099
-29920
lines changed

ReactAndroid/src/main/java/com/facebook/react/v8executor/OnLoad.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#include <react/jni/JSLogging.h>
1313
#include <react/jni/ReadableNativeMap.h>
1414

15+
namespace facebook {
16+
namespace v8runtime {
17+
std::unique_ptr<jsi::Runtime> makeV8Runtime();
18+
} // namespace v8runtime
19+
} // namespace facebook
20+
1521
namespace facebook {
1622
namespace react {
1723

@@ -25,16 +31,13 @@ class V8ExecutorFactory : public JSExecutorFactory {
2531

2632
std::unique_ptr<JSExecutor> createJSExecutor(
2733
std::shared_ptr<ExecutorDelegate> delegate,
28-
std::shared_ptr<MessageQueueThread> jsQueue) override {
29-
30-
auto logger = std::make_shared<JSIExecutor::Logger>([](const std::string& message, unsigned int logLevel) {
31-
reactAndroidLoggingHook(message, logLevel);
32-
});
33-
34+
std::shared_ptr<MessageQueueThread> jsQueue) override {
3435
return folly::make_unique<JSIExecutor>(
35-
facebook::v8runtime::makeV8Runtime(m_v8Config, logger),
36+
facebook::v8runtime::makeV8Runtime(m_v8Config),
3637
delegate,
37-
*logger,
38+
[](const std::string& message, unsigned int logLevel) {
39+
reactAndroidLoggingHook(message, logLevel);
40+
},
3841
JSIExecutor::defaultTimeoutInvoker,
3942
nullptr);
4043
}

ReactCommon/jsi/V8Runtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace v8runtime {
6060
std::unique_ptr<const jsi::Buffer> custom_snapshot = nullptr); /*Optional*/
6161

6262
std::unique_ptr<jsi::Runtime> makeV8Runtime();
63-
std::unique_ptr<jsi::Runtime> makeV8Runtime(const folly::dynamic& v8Config, const std::shared_ptr<Logger>& logger);
63+
std::unique_ptr<jsi::Runtime> makeV8Runtime(const folly::dynamic& v8Config);
6464

6565
} // namespace v8runtime
6666
} // namespace facebook

ReactCommon/jsi/V8Runtime_droid.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ namespace facebook { namespace v8runtime {
5050
}
5151
}
5252

53-
V8Runtime::V8Runtime(const folly::dynamic& v8Config, const std::shared_ptr<Logger>& logger) : V8Runtime() {
54-
logger_ = logger;
53+
V8Runtime::V8Runtime(const folly::dynamic& v8Config) : V8Runtime() {
5554
isCacheEnabled_ = IsCacheEnabled(v8Config);
5655
shouldProduceFullCache_ = ShouldProduceFullCache(v8Config);
5756
shouldSetNoLazyFlag_ = ShouldSetNoLazyFlag(v8Config);

ReactCommon/jsi/V8Runtime_impl.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace facebook { namespace v8runtime {
4343
class V8Runtime : public jsi::Runtime {
4444
public:
4545
V8Runtime();
46-
V8Runtime(const folly::dynamic& v8Config, const std::shared_ptr<Logger>& logger);
46+
V8Runtime(const folly::dynamic& v8Config);
4747

4848
V8Runtime(const v8::Platform* platform, std::shared_ptr<Logger>&& logger,
4949
std::shared_ptr<facebook::react::MessageQueueThread>&& jsQueue, std::shared_ptr<CacheProvider>&& cacheProvider,
@@ -374,12 +374,6 @@ namespace facebook { namespace v8runtime {
374374
bool ExecuteString(v8::Local<v8::String> source, const jsi::Buffer* cache, v8::Local<v8::Value> name, bool report_exceptions);
375375
bool ExecuteString(const v8::Local<v8::String>& source, const std::string& sourceURL);
376376

377-
void Log(const std::string& message, const unsigned int logLevel) {
378-
if (logger_) {
379-
(*logger_)("V8Runtime:: " + message, logLevel);
380-
}
381-
}
382-
383377
void ReportException(v8::TryCatch* try_catch);
384378

385379
v8::Isolate* GetIsolate() const { return isolate_; }

ReactCommon/jsi/V8Runtime_shared.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,7 @@ namespace facebook { namespace v8runtime {
247247
if (message.IsEmpty()) {
248248
// V8 didn't provide any extra information about this error; just
249249
// throw the exception.
250-
std::string errorMessage{ "<Unknown exception>" };
251-
Log(errorMessage, 3 /*LogLevel error*/);
252-
throw jsi::JSError(*this, errorMessage);
250+
throw jsi::JSError(*this, "<Unknown exception>");
253251
}
254252
else {
255253
// Print (filename):(line number): (message).
@@ -285,9 +283,7 @@ namespace facebook { namespace v8runtime {
285283
sstr << stack_trace_string2 << std::endl;
286284
}
287285

288-
std::string errorMessage{ sstr.str() };
289-
Log(errorMessage, 3 /*LogLevel error*/);
290-
throw jsi::JSError(*this, errorMessage);
286+
throw jsi::JSError(*this, sstr.str());
291287
}
292288
}
293289

@@ -744,7 +740,7 @@ namespace facebook { namespace v8runtime {
744740
return std::make_unique<V8Runtime>();
745741
}
746742

747-
std::unique_ptr<jsi::Runtime> makeV8Runtime(const folly::dynamic& v8Config, const std::shared_ptr<Logger>& logger) {
748-
return std::make_unique<V8Runtime>(v8Config, logger);
743+
std::unique_ptr<jsi::Runtime> makeV8Runtime(const folly::dynamic& v8Config) {
744+
return std::make_unique<V8Runtime>(v8Config);
749745
}
750-
}} // namespace facebook::v8runtime
746+
}} // namespace facebook::v8runtime

glog/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ autom4te.cache
22
glog-*.tar.gz
33
packages/rpm-unknown
44
packages/debian-*
5+
CMakeCache.txt
6+
CMakeFiles/
7+
*.cmake
8+
config.h
9+
*.sln
10+
*.vcxproj
11+
*.filters
12+
bazel-*

glog/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
Abhishek Dasgupta <[email protected]>
1212
Abhishek Parmar <[email protected]>
13+
Andrew Schwartzmeyer <[email protected]>
1314
Andy Ying <[email protected]>
1415
Brian Silverman <[email protected]>
1516
Google Inc.
@@ -20,3 +21,4 @@ romange <[email protected]>
2021
Sergiu Deitsch <[email protected]>
2122
2223
Teddy Reed <[email protected]>
24+
Zhongming Qu <[email protected]>

glog/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
licenses(['notice'])
2+
3+
load(':bazel/glog.bzl', 'glog_library')
4+
5+
glog_library()

0 commit comments

Comments
 (0)