From 6fda334a00dedca7c9b24e17e03cab71a2bdbc27 Mon Sep 17 00:00:00 2001 From: Daniel Buchele Date: Mon, 25 Jun 2018 04:33:04 -0700 Subject: [PATCH] fbshipit-source-id: 5d9ecf33fca19e4a6b8c979b879ec9dd82af1ef9 --- .eslintrc.js | 1 + .../FBCxxUtils/FBCxxFollyDynamicConvert.h | 8 +- libs/fbjni/BUCK | 81 --- libs/fbjni/cxx/fbjni/ByteBuffer.cpp | 17 +- libs/fbjni/cxx/fbjni/ByteBuffer.h | 17 +- libs/fbjni/cxx/fbjni/Context.h | 17 +- libs/fbjni/cxx/fbjni/File.h | 17 +- libs/fbjni/cxx/fbjni/JThread.h | 17 +- libs/fbjni/cxx/fbjni/NativeRunnable.h | 17 +- libs/fbjni/cxx/fbjni/OnLoad.cpp | 17 +- libs/fbjni/cxx/fbjni/ReadableByteChannel.cpp | 17 +- libs/fbjni/cxx/fbjni/ReadableByteChannel.h | 17 +- libs/fbjni/cxx/fbjni/detail/Boxed.h | 17 +- libs/fbjni/cxx/fbjni/detail/Common.h | 17 +- libs/fbjni/cxx/fbjni/detail/CoreClasses-inl.h | 17 +- libs/fbjni/cxx/fbjni/detail/CoreClasses.h | 17 +- libs/fbjni/cxx/fbjni/detail/Environment.cpp | 17 +- libs/fbjni/cxx/fbjni/detail/Environment.h | 17 +- libs/fbjni/cxx/fbjni/detail/Exceptions.cpp | 17 +- libs/fbjni/cxx/fbjni/detail/Exceptions.h | 17 +- libs/fbjni/cxx/fbjni/detail/Hybrid.cpp | 17 +- libs/fbjni/cxx/fbjni/detail/Hybrid.h | 17 +- libs/fbjni/cxx/fbjni/detail/Iterator-inl.h | 17 +- libs/fbjni/cxx/fbjni/detail/Iterator.h | 17 +- libs/fbjni/cxx/fbjni/detail/JWeakReference.h | 17 +- libs/fbjni/cxx/fbjni/detail/Log.h | 17 +- libs/fbjni/cxx/fbjni/detail/Meta-forward.h | 17 +- libs/fbjni/cxx/fbjni/detail/Meta-inl.h | 17 +- libs/fbjni/cxx/fbjni/detail/Meta.h | 17 +- libs/fbjni/cxx/fbjni/detail/MetaConvert.h | 17 +- .../fbjni/detail/ReferenceAllocators-inl.h | 17 +- .../cxx/fbjni/detail/ReferenceAllocators.h | 17 +- .../cxx/fbjni/detail/References-forward.h | 17 +- libs/fbjni/cxx/fbjni/detail/References-inl.h | 17 +- libs/fbjni/cxx/fbjni/detail/References.cpp | 17 +- libs/fbjni/cxx/fbjni/detail/References.h | 18 +- .../fbjni/cxx/fbjni/detail/Registration-inl.h | 17 +- libs/fbjni/cxx/fbjni/detail/Registration.h | 17 +- libs/fbjni/cxx/fbjni/detail/TypeTraits.h | 17 +- libs/fbjni/cxx/fbjni/detail/utf8.cpp | 17 +- libs/fbjni/cxx/fbjni/detail/utf8.h | 17 +- libs/fbjni/cxx/fbjni/fbjni.cpp | 17 +- libs/fbjni/cxx/fbjni/fbjni.h | 17 +- libs/fbjni/cxx/lyra/cxa_throw.cpp | 17 +- libs/fbjni/cxx/lyra/lyra.cpp | 17 +- libs/fbjni/cxx/lyra/lyra.h | 17 +- libs/fbjni/cxx/lyra/lyra_breakpad.cpp | 17 +- libs/fbjni/cxx/lyra/lyra_exceptions.cpp | 17 +- libs/fbjni/cxx/lyra/lyra_exceptions.h | 17 +- .../java/com/facebook/jni/CppException.java | 17 +- .../facebook/jni/CppSystemErrorException.java | 17 +- .../com/facebook/jni/DestructorThread.java | 17 +- .../com/facebook/jni/HybridClassBase.java | 17 +- .../java/com/facebook/jni/HybridData.java | 17 +- .../java/com/facebook/jni/IteratorHelper.java | 16 +- .../com/facebook/jni/MapIteratorHelper.java | 16 +- .../java/com/facebook/jni/NativeRunnable.java | 16 +- .../com/facebook/jni/ThreadScopeSupport.java | 17 +- .../com/facebook/jni/UnknownCppException.java | 17 +- .../facebook/jni/annotations/DoNotStrip.java | 24 +- src/App.js | 28 +- src/device-plugins/logs/LogTable.js | 562 ------------------ src/device-plugins/logs/LogWatcher.js | 9 +- src/device-plugins/logs/index.js | 557 ++++++++++++++++- src/dispatcher/iOSDevice.js | 84 +-- src/server.js | 28 +- src/ui/components/ErrorBoundary.js | 2 +- src/utils/CertificateProvider.js | 18 +- xplat/Sonar/SonarClient.cpp | 2 +- xplat/Sonar/SonarWebSocketImpl.cpp | 6 +- 70 files changed, 896 insertions(+), 1464 deletions(-) delete mode 100644 libs/fbjni/BUCK delete mode 100644 src/device-plugins/logs/LogTable.js diff --git a/.eslintrc.js b/.eslintrc.js index 4373cd483..ca81c01b8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,7 @@ module.exports = { 'consistent-return': 0, 'max-len': 0, // let's take prettier take care of this indent: 0, // let's take prettier take care of this + 'no-console': 0, // we're setting window.console in App.js // additional rules for this project 'header/header': [2, 'block', {pattern}], diff --git a/iOS/SonarKit/FBCxxUtils/FBCxxFollyDynamicConvert.h b/iOS/SonarKit/FBCxxUtils/FBCxxFollyDynamicConvert.h index 88412eac2..dbd834633 100644 --- a/iOS/SonarKit/FBCxxUtils/FBCxxFollyDynamicConvert.h +++ b/iOS/SonarKit/FBCxxUtils/FBCxxFollyDynamicConvert.h @@ -1,10 +1,4 @@ -/* - * Copyright (c) 2004-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the LICENSE - * file in the root directory of this source tree. - * - */ +// Copyright 2004-present Facebook. All Rights Reserved. #pragma once #import diff --git a/libs/fbjni/BUCK b/libs/fbjni/BUCK deleted file mode 100644 index 43eee3b67..000000000 --- a/libs/fbjni/BUCK +++ /dev/null @@ -1,81 +0,0 @@ -load("//build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") -load("@xplat//build_defs:fb_java_library.bzl", "fb_java_library") - -ANNOTATIONS_SRCS = [ - "java/com/facebook/jni/annotations/*.java", -] - -fb_java_library( - name = "java_annotations", - srcs = glob(ANNOTATIONS_SRCS), - required_for_source_only_abi = True, -) - -fb_java_library( - name = "java", - srcs = glob( - ["java/**/*.java"], - exclude = ANNOTATIONS_SRCS, - ), - required_for_source_only_abi = True, - visibility = ["PUBLIC"], - deps = [ - "//libraries/soloader/java/com/facebook/soloader:soloader", - "//third-party/java/jsr-305:jsr-305", - ], - exported_deps = [ - ":java_annotations", - ], -) - -fb_xplat_cxx_library( - name = "fbjni", - srcs = glob([ - "cxx/fbjni/**/*.cpp", - ]), - header_namespace = "", - exported_headers = subdir_glob([ - ("cxx", "fbjni/**/*.h"), - ]), - allow_jni_merging = True, - compiler_flags = [ - "-fexceptions", - "-fno-omit-frame-pointer", - "-frtti", - "-ffunction-sections", - ], - enable_static_variant = True, - exported_platform_headers = [ - ( - "^(?!android-arm$).*$", - subdir_glob([ - ("cxx", "lyra/**/*.h"), - ]), - ), - ], - fbandroid_deps = [ - "xplat//third-party/linker_lib:atomic", - ], - platform_srcs = [ - ( - "^(?!android-arm$).*$", - glob([ - "cxx/lyra/*.cpp", - ]), - ), - ], - preprocessor_flags = [ - "-DLOG_TAG=\"libfbjni\"", - ], - soname = "libfbjni.$(ext)", - visibility = [ - "PUBLIC", - ], - deps = [ - "xplat//third-party/linker_lib:android", - ], - exported_deps = [ - "xplat//third-party/linker_lib:log", - "//native/jni-hack:jni-hack", - ], -) diff --git a/libs/fbjni/cxx/fbjni/ByteBuffer.cpp b/libs/fbjni/cxx/fbjni/ByteBuffer.cpp index 82060d74d..bf8f6c55e 100644 --- a/libs/fbjni/cxx/fbjni/ByteBuffer.cpp +++ b/libs/fbjni/cxx/fbjni/ByteBuffer.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include diff --git a/libs/fbjni/cxx/fbjni/ByteBuffer.h b/libs/fbjni/cxx/fbjni/ByteBuffer.h index 91beff2f5..d4d4fa0a8 100644 --- a/libs/fbjni/cxx/fbjni/ByteBuffer.h +++ b/libs/fbjni/cxx/fbjni/ByteBuffer.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/Context.h b/libs/fbjni/cxx/fbjni/Context.h index ca75972fd..24427e8a3 100644 --- a/libs/fbjni/cxx/fbjni/Context.h +++ b/libs/fbjni/cxx/fbjni/Context.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/File.h b/libs/fbjni/cxx/fbjni/File.h index f9966c6ae..414deeef7 100644 --- a/libs/fbjni/cxx/fbjni/File.h +++ b/libs/fbjni/cxx/fbjni/File.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/JThread.h b/libs/fbjni/cxx/fbjni/JThread.h index 6bdb269f2..671b247b6 100644 --- a/libs/fbjni/cxx/fbjni/JThread.h +++ b/libs/fbjni/cxx/fbjni/JThread.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/NativeRunnable.h b/libs/fbjni/cxx/fbjni/NativeRunnable.h index d2f911c95..054500d50 100644 --- a/libs/fbjni/cxx/fbjni/NativeRunnable.h +++ b/libs/fbjni/cxx/fbjni/NativeRunnable.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/OnLoad.cpp b/libs/fbjni/cxx/fbjni/OnLoad.cpp index 2282131ef..80b50622e 100644 --- a/libs/fbjni/cxx/fbjni/OnLoad.cpp +++ b/libs/fbjni/cxx/fbjni/OnLoad.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include diff --git a/libs/fbjni/cxx/fbjni/ReadableByteChannel.cpp b/libs/fbjni/cxx/fbjni/ReadableByteChannel.cpp index 9970d2842..0c00601b5 100644 --- a/libs/fbjni/cxx/fbjni/ReadableByteChannel.cpp +++ b/libs/fbjni/cxx/fbjni/ReadableByteChannel.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include namespace facebook { diff --git a/libs/fbjni/cxx/fbjni/ReadableByteChannel.h b/libs/fbjni/cxx/fbjni/ReadableByteChannel.h index cded4a603..3ce0beda0 100644 --- a/libs/fbjni/cxx/fbjni/ReadableByteChannel.h +++ b/libs/fbjni/cxx/fbjni/ReadableByteChannel.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/Boxed.h b/libs/fbjni/cxx/fbjni/detail/Boxed.h index 3628639bd..b2621dd3f 100644 --- a/libs/fbjni/cxx/fbjni/detail/Boxed.h +++ b/libs/fbjni/cxx/fbjni/detail/Boxed.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include "CoreClasses.h" diff --git a/libs/fbjni/cxx/fbjni/detail/Common.h b/libs/fbjni/cxx/fbjni/detail/Common.h index b207cee84..1075cf19b 100644 --- a/libs/fbjni/cxx/fbjni/detail/Common.h +++ b/libs/fbjni/cxx/fbjni/detail/Common.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - /** @file Common.h * * Defining the stuff that don't deserve headers of their own... diff --git a/libs/fbjni/cxx/fbjni/detail/CoreClasses-inl.h b/libs/fbjni/cxx/fbjni/detail/CoreClasses-inl.h index 6d6db77e6..87fa7b6e3 100644 --- a/libs/fbjni/cxx/fbjni/detail/CoreClasses-inl.h +++ b/libs/fbjni/cxx/fbjni/detail/CoreClasses-inl.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/CoreClasses.h b/libs/fbjni/cxx/fbjni/detail/CoreClasses.h index 47c551a51..dc29bf434 100644 --- a/libs/fbjni/cxx/fbjni/detail/CoreClasses.h +++ b/libs/fbjni/cxx/fbjni/detail/CoreClasses.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once /** @file CoreClasses.h diff --git a/libs/fbjni/cxx/fbjni/detail/Environment.cpp b/libs/fbjni/cxx/fbjni/detail/Environment.cpp index 4911076cc..2222dca0c 100644 --- a/libs/fbjni/cxx/fbjni/detail/Environment.cpp +++ b/libs/fbjni/cxx/fbjni/detail/Environment.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include diff --git a/libs/fbjni/cxx/fbjni/detail/Environment.h b/libs/fbjni/cxx/fbjni/detail/Environment.h index e48fcbe89..729507002 100644 --- a/libs/fbjni/cxx/fbjni/detail/Environment.h +++ b/libs/fbjni/cxx/fbjni/detail/Environment.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include #include diff --git a/libs/fbjni/cxx/fbjni/detail/Exceptions.cpp b/libs/fbjni/cxx/fbjni/detail/Exceptions.cpp index 6291d54ad..3ccd7386b 100644 --- a/libs/fbjni/cxx/fbjni/detail/Exceptions.cpp +++ b/libs/fbjni/cxx/fbjni/detail/Exceptions.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include "CoreClasses.h" #include "Log.h" diff --git a/libs/fbjni/cxx/fbjni/detail/Exceptions.h b/libs/fbjni/cxx/fbjni/detail/Exceptions.h index 2073beba1..7eb01256d 100644 --- a/libs/fbjni/cxx/fbjni/detail/Exceptions.h +++ b/libs/fbjni/cxx/fbjni/detail/Exceptions.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - /** * @file Exceptions.h * diff --git a/libs/fbjni/cxx/fbjni/detail/Hybrid.cpp b/libs/fbjni/cxx/fbjni/detail/Hybrid.cpp index 3ba4f4d0e..787d37084 100644 --- a/libs/fbjni/cxx/fbjni/detail/Hybrid.cpp +++ b/libs/fbjni/cxx/fbjni/detail/Hybrid.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include namespace facebook { diff --git a/libs/fbjni/cxx/fbjni/detail/Hybrid.h b/libs/fbjni/cxx/fbjni/detail/Hybrid.h index d84dd31e1..86354d202 100644 --- a/libs/fbjni/cxx/fbjni/detail/Hybrid.h +++ b/libs/fbjni/cxx/fbjni/detail/Hybrid.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/Iterator-inl.h b/libs/fbjni/cxx/fbjni/detail/Iterator-inl.h index d915c69fb..8cc4819cf 100644 --- a/libs/fbjni/cxx/fbjni/detail/Iterator-inl.h +++ b/libs/fbjni/cxx/fbjni/detail/Iterator-inl.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once namespace facebook { diff --git a/libs/fbjni/cxx/fbjni/detail/Iterator.h b/libs/fbjni/cxx/fbjni/detail/Iterator.h index 02c5c4607..2586a6237 100644 --- a/libs/fbjni/cxx/fbjni/detail/Iterator.h +++ b/libs/fbjni/cxx/fbjni/detail/Iterator.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include "CoreClasses.h" diff --git a/libs/fbjni/cxx/fbjni/detail/JWeakReference.h b/libs/fbjni/cxx/fbjni/detail/JWeakReference.h index 433c6f890..29c514711 100644 --- a/libs/fbjni/cxx/fbjni/detail/JWeakReference.h +++ b/libs/fbjni/cxx/fbjni/detail/JWeakReference.h @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include "CoreClasses.h" diff --git a/libs/fbjni/cxx/fbjni/detail/Log.h b/libs/fbjni/cxx/fbjni/detail/Log.h index dbc57abdf..d59fb37d8 100644 --- a/libs/fbjni/cxx/fbjni/detail/Log.h +++ b/libs/fbjni/cxx/fbjni/detail/Log.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - /** @file ALog.h * * Very simple (android only) logging. Define LOG_TAG to enable the macros. diff --git a/libs/fbjni/cxx/fbjni/detail/Meta-forward.h b/libs/fbjni/cxx/fbjni/detail/Meta-forward.h index 84b015249..b965e452a 100644 --- a/libs/fbjni/cxx/fbjni/detail/Meta-forward.h +++ b/libs/fbjni/cxx/fbjni/detail/Meta-forward.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once namespace facebook { diff --git a/libs/fbjni/cxx/fbjni/detail/Meta-inl.h b/libs/fbjni/cxx/fbjni/detail/Meta-inl.h index bd7f5bfdb..f750ff4fd 100644 --- a/libs/fbjni/cxx/fbjni/detail/Meta-inl.h +++ b/libs/fbjni/cxx/fbjni/detail/Meta-inl.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/Meta.h b/libs/fbjni/cxx/fbjni/detail/Meta.h index 739de84f8..e03ba7d78 100644 --- a/libs/fbjni/cxx/fbjni/detail/Meta.h +++ b/libs/fbjni/cxx/fbjni/detail/Meta.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - /** @file meta.h * * Provides wrappers for meta data such as methods and fields. diff --git a/libs/fbjni/cxx/fbjni/detail/MetaConvert.h b/libs/fbjni/cxx/fbjni/detail/MetaConvert.h index 71ea8b157..9eb1cfb94 100644 --- a/libs/fbjni/cxx/fbjni/detail/MetaConvert.h +++ b/libs/fbjni/cxx/fbjni/detail/MetaConvert.h @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators-inl.h b/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators-inl.h index 3a42d364c..d5eb2b280 100644 --- a/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators-inl.h +++ b/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators-inl.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators.h b/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators.h index 7278ed094..bc0fe1765 100644 --- a/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators.h +++ b/libs/fbjni/cxx/fbjni/detail/ReferenceAllocators.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - /** * @file ReferenceAllocators.h * diff --git a/libs/fbjni/cxx/fbjni/detail/References-forward.h b/libs/fbjni/cxx/fbjni/detail/References-forward.h index 9b68d614f..7b02bda95 100644 --- a/libs/fbjni/cxx/fbjni/detail/References-forward.h +++ b/libs/fbjni/cxx/fbjni/detail/References-forward.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include "ReferenceAllocators.h" diff --git a/libs/fbjni/cxx/fbjni/detail/References-inl.h b/libs/fbjni/cxx/fbjni/detail/References-inl.h index 7fc17671e..fc38ad208 100644 --- a/libs/fbjni/cxx/fbjni/detail/References-inl.h +++ b/libs/fbjni/cxx/fbjni/detail/References-inl.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/References.cpp b/libs/fbjni/cxx/fbjni/detail/References.cpp index 6062c49ca..adefe6545 100644 --- a/libs/fbjni/cxx/fbjni/detail/References.cpp +++ b/libs/fbjni/cxx/fbjni/detail/References.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include "References.h" namespace facebook { diff --git a/libs/fbjni/cxx/fbjni/detail/References.h b/libs/fbjni/cxx/fbjni/detail/References.h index 2cd0d8482..ca226eaee 100644 --- a/libs/fbjni/cxx/fbjni/detail/References.h +++ b/libs/fbjni/cxx/fbjni/detail/References.h @@ -1,20 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - - /** @file References.h * * Functionality similar to smart pointers, but for references into the VM. Four main reference diff --git a/libs/fbjni/cxx/fbjni/detail/Registration-inl.h b/libs/fbjni/cxx/fbjni/detail/Registration-inl.h index f7171a6a3..76ed9215e 100644 --- a/libs/fbjni/cxx/fbjni/detail/Registration-inl.h +++ b/libs/fbjni/cxx/fbjni/detail/Registration-inl.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include "Exceptions.h" diff --git a/libs/fbjni/cxx/fbjni/detail/Registration.h b/libs/fbjni/cxx/fbjni/detail/Registration.h index 924538757..9f1223962 100644 --- a/libs/fbjni/cxx/fbjni/detail/Registration.h +++ b/libs/fbjni/cxx/fbjni/detail/Registration.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/TypeTraits.h b/libs/fbjni/cxx/fbjni/detail/TypeTraits.h index dc9fbb019..229ed4aaf 100644 --- a/libs/fbjni/cxx/fbjni/detail/TypeTraits.h +++ b/libs/fbjni/cxx/fbjni/detail/TypeTraits.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/detail/utf8.cpp b/libs/fbjni/cxx/fbjni/detail/utf8.cpp index 2cda26d6d..309379ea5 100644 --- a/libs/fbjni/cxx/fbjni/detail/utf8.cpp +++ b/libs/fbjni/cxx/fbjni/detail/utf8.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include "utf8.h" #include "Log.h" diff --git a/libs/fbjni/cxx/fbjni/detail/utf8.h b/libs/fbjni/cxx/fbjni/detail/utf8.h index b1b8558db..7bc7d4079 100644 --- a/libs/fbjni/cxx/fbjni/detail/utf8.h +++ b/libs/fbjni/cxx/fbjni/detail/utf8.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/fbjni/fbjni.cpp b/libs/fbjni/cxx/fbjni/fbjni.cpp index a8e78a1e9..82da45f34 100644 --- a/libs/fbjni/cxx/fbjni/fbjni.cpp +++ b/libs/fbjni/cxx/fbjni/fbjni.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include diff --git a/libs/fbjni/cxx/fbjni/fbjni.h b/libs/fbjni/cxx/fbjni/fbjni.h index 9af170ce0..646a4ad45 100644 --- a/libs/fbjni/cxx/fbjni/fbjni.h +++ b/libs/fbjni/cxx/fbjni/fbjni.h @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/lyra/cxa_throw.cpp b/libs/fbjni/cxx/lyra/cxa_throw.cpp index e0449d9a5..d320cbc5d 100644 --- a/libs/fbjni/cxx/lyra/cxa_throw.cpp +++ b/libs/fbjni/cxx/lyra/cxa_throw.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include #include diff --git a/libs/fbjni/cxx/lyra/lyra.cpp b/libs/fbjni/cxx/lyra/lyra.cpp index 2a59c2a2e..080d001c3 100644 --- a/libs/fbjni/cxx/lyra/lyra.cpp +++ b/libs/fbjni/cxx/lyra/lyra.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include diff --git a/libs/fbjni/cxx/lyra/lyra.h b/libs/fbjni/cxx/lyra/lyra.h index 60698d1bb..138a8ae89 100644 --- a/libs/fbjni/cxx/lyra/lyra.h +++ b/libs/fbjni/cxx/lyra/lyra.h @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/cxx/lyra/lyra_breakpad.cpp b/libs/fbjni/cxx/lyra/lyra_breakpad.cpp index 0c810f411..0f515f660 100644 --- a/libs/fbjni/cxx/lyra/lyra_breakpad.cpp +++ b/libs/fbjni/cxx/lyra/lyra_breakpad.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include namespace facebook { diff --git a/libs/fbjni/cxx/lyra/lyra_exceptions.cpp b/libs/fbjni/cxx/lyra/lyra_exceptions.cpp index 0664f8047..1c0c9419d 100644 --- a/libs/fbjni/cxx/lyra/lyra_exceptions.cpp +++ b/libs/fbjni/cxx/lyra/lyra_exceptions.cpp @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #include #include diff --git a/libs/fbjni/cxx/lyra/lyra_exceptions.h b/libs/fbjni/cxx/lyra/lyra_exceptions.h index e04c276af..8e3028f53 100644 --- a/libs/fbjni/cxx/lyra/lyra_exceptions.h +++ b/libs/fbjni/cxx/lyra/lyra_exceptions.h @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - #pragma once #include diff --git a/libs/fbjni/java/com/facebook/jni/CppException.java b/libs/fbjni/java/com/facebook/jni/CppException.java index b84425d2a..45e33e9cb 100644 --- a/libs/fbjni/java/com/facebook/jni/CppException.java +++ b/libs/fbjni/java/com/facebook/jni/CppException.java @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import com.facebook.jni.annotations.DoNotStrip; diff --git a/libs/fbjni/java/com/facebook/jni/CppSystemErrorException.java b/libs/fbjni/java/com/facebook/jni/CppSystemErrorException.java index a7067a0d4..894a3e570 100644 --- a/libs/fbjni/java/com/facebook/jni/CppSystemErrorException.java +++ b/libs/fbjni/java/com/facebook/jni/CppSystemErrorException.java @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import com.facebook.jni.annotations.DoNotStrip; diff --git a/libs/fbjni/java/com/facebook/jni/DestructorThread.java b/libs/fbjni/java/com/facebook/jni/DestructorThread.java index 233db8d4d..23ea64413 100644 --- a/libs/fbjni/java/com/facebook/jni/DestructorThread.java +++ b/libs/fbjni/java/com/facebook/jni/DestructorThread.java @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import java.lang.ref.PhantomReference; diff --git a/libs/fbjni/java/com/facebook/jni/HybridClassBase.java b/libs/fbjni/java/com/facebook/jni/HybridClassBase.java index c850dabaf..f9e1b64e0 100644 --- a/libs/fbjni/java/com/facebook/jni/HybridClassBase.java +++ b/libs/fbjni/java/com/facebook/jni/HybridClassBase.java @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import com.facebook.jni.annotations.DoNotStrip; diff --git a/libs/fbjni/java/com/facebook/jni/HybridData.java b/libs/fbjni/java/com/facebook/jni/HybridData.java index 8a750bece..26dde9e8b 100644 --- a/libs/fbjni/java/com/facebook/jni/HybridData.java +++ b/libs/fbjni/java/com/facebook/jni/HybridData.java @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import com.facebook.jni.annotations.DoNotStrip; diff --git a/libs/fbjni/java/com/facebook/jni/IteratorHelper.java b/libs/fbjni/java/com/facebook/jni/IteratorHelper.java index 852f7ec98..f5652ecda 100644 --- a/libs/fbjni/java/com/facebook/jni/IteratorHelper.java +++ b/libs/fbjni/java/com/facebook/jni/IteratorHelper.java @@ -1,17 +1,9 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package com.facebook.jni; diff --git a/libs/fbjni/java/com/facebook/jni/MapIteratorHelper.java b/libs/fbjni/java/com/facebook/jni/MapIteratorHelper.java index 342d549fe..0e25abba2 100644 --- a/libs/fbjni/java/com/facebook/jni/MapIteratorHelper.java +++ b/libs/fbjni/java/com/facebook/jni/MapIteratorHelper.java @@ -1,17 +1,9 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package com.facebook.jni; diff --git a/libs/fbjni/java/com/facebook/jni/NativeRunnable.java b/libs/fbjni/java/com/facebook/jni/NativeRunnable.java index a7b2cbf6a..4e0c22b4b 100644 --- a/libs/fbjni/java/com/facebook/jni/NativeRunnable.java +++ b/libs/fbjni/java/com/facebook/jni/NativeRunnable.java @@ -1,17 +1,9 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package com.facebook.jni; diff --git a/libs/fbjni/java/com/facebook/jni/ThreadScopeSupport.java b/libs/fbjni/java/com/facebook/jni/ThreadScopeSupport.java index 82ed31ce4..260d7228d 100644 --- a/libs/fbjni/java/com/facebook/jni/ThreadScopeSupport.java +++ b/libs/fbjni/java/com/facebook/jni/ThreadScopeSupport.java @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import com.facebook.jni.annotations.DoNotStrip; diff --git a/libs/fbjni/java/com/facebook/jni/UnknownCppException.java b/libs/fbjni/java/com/facebook/jni/UnknownCppException.java index 3a0e70d79..4f49c8429 100644 --- a/libs/fbjni/java/com/facebook/jni/UnknownCppException.java +++ b/libs/fbjni/java/com/facebook/jni/UnknownCppException.java @@ -1,19 +1,10 @@ -/** - * Copyright 2018-present, Facebook, Inc. +/* + * Copyright (c) 2018-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni; import com.facebook.jni.annotations.DoNotStrip; diff --git a/libs/fbjni/java/com/facebook/jni/annotations/DoNotStrip.java b/libs/fbjni/java/com/facebook/jni/annotations/DoNotStrip.java index 7e7facd39..e0e25b668 100644 --- a/libs/fbjni/java/com/facebook/jni/annotations/DoNotStrip.java +++ b/libs/fbjni/java/com/facebook/jni/annotations/DoNotStrip.java @@ -1,19 +1,10 @@ -/** - * Copyright 2004-present, Facebook, Inc. +/* + * Copyright (c) 2004-present, Facebook, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ - package com.facebook.jni.annotations; import static java.lang.annotation.RetentionPolicy.CLASS; @@ -25,9 +16,8 @@ import java.lang.annotation.Target; /** * Add this annotation to a class, method, or field to instruct Proguard to not strip it out. * - * This is useful for methods called via reflection that could appear as unused to Proguard. + *

This is useful for methods called via reflection that could appear as unused to Proguard. */ -@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(CLASS) -public @interface DoNotStrip { -} +public @interface DoNotStrip {} diff --git a/src/App.js b/src/App.js index 5588d40ec..3dabeef24 100644 --- a/src/App.js +++ b/src/App.js @@ -63,7 +63,9 @@ export class App extends React.Component { super(); this.initTracking(); + setupEnvironment(); this.logger = new Logger(); + replaceGlobalConsole(this.logger); this.state = { activeAppKey: null, @@ -76,7 +78,6 @@ export class App extends React.Component { this.bugReporter = new BugReporter(this.logger); this.commandLineArgs = yargs.parse(electron.remote.process.argv); - setupMenu(this.sendKeyboardAction); } @@ -358,3 +359,28 @@ export default connect( }), {toggleBugDialogVisible}, )(App); + +function replaceGlobalConsole(logger: Logger) { + const loggerMethods = { + log: logger.info, + warn: logger.warn, + error: logger.error, + }; + const consoleHandler = { + get: function(obj, prop) { + return prop in loggerMethods + ? args => { + obj[prop] && obj[prop](args); + return loggerMethods[prop].bind(logger)(args); + } + : obj[prop]; + }, + }; + window.console = new Proxy(console, consoleHandler); +} + +function setupEnvironment() { + if (!process.env.ANDROID_HOME) { + process.env.ANDROID_HOME = '/opt/android_sdk'; + } +} diff --git a/src/device-plugins/logs/LogTable.js b/src/device-plugins/logs/LogTable.js deleted file mode 100644 index 919c1a735..000000000 --- a/src/device-plugins/logs/LogTable.js +++ /dev/null @@ -1,562 +0,0 @@ -/** - * Copyright 2018-present Facebook. - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * @format - */ - -import type { - TableBodyRow, - TableColumnOrder, - TableColumnSizes, - TableColumns, -} from 'sonar'; -import type {Counter} from './LogWatcher.js'; -import type {DeviceLogEntry} from '../../devices/BaseDevice.js'; - -import { - Text, - ManagedTable, - Button, - colors, - FlexCenter, - LoadingIndicator, - ContextMenu, - FlexColumn, - Glyph, -} from 'sonar'; -import {SonarDevicePlugin, SearchableTable} from 'sonar'; -import textContent from '../../utils/textContent.js'; -import createPaste from '../../utils/createPaste.js'; -import LogWatcher from './LogWatcher'; - -const LOG_WATCHER_LOCAL_STORAGE_KEY = 'LOG_WATCHER_LOCAL_STORAGE_KEY'; - -type Entries = Array<{ - row: TableBodyRow, - entry: DeviceLogEntry, -}>; - -type LogsState = {| - initialising: boolean, - rows: Array, - entries: Entries, - key2entry: {[key: string]: DeviceLogEntry}, - highlightedRows: Array, - counters: Array, -|}; - -const Icon = Glyph.extends({ - marginTop: 5, -}); - -function getLineCount(str: string): number { - let count = 1; - for (let i = 0; i < str.length; i++) { - if (str[i] === '\n') { - count++; - } - } - return count; -} - -function keepKeys(obj, keys) { - const result = {}; - for (const key in obj) { - if (keys.includes(key)) { - result[key] = obj[key]; - } - } - return result; -} - -const COLUMN_SIZE = { - type: 32, - time: 120, - pid: 60, - tid: 60, - tag: 120, - app: 200, - message: 'flex', -}; - -const COLUMNS = { - type: { - value: '', - }, - time: { - value: 'Time', - }, - pid: { - value: 'PID', - }, - tid: { - value: 'TID', - }, - tag: { - value: 'Tag', - }, - app: { - value: 'App', - }, - message: { - value: 'Message', - }, -}; - -const INITIAL_COLUMN_ORDER = [ - { - key: 'type', - visible: true, - }, - { - key: 'time', - visible: false, - }, - { - key: 'pid', - visible: false, - }, - { - key: 'tid', - visible: false, - }, - { - key: 'tag', - visible: true, - }, - { - key: 'app', - visible: true, - }, - { - key: 'message', - visible: true, - }, -]; - -const LOG_TYPES: { - [level: string]: { - label: string, - color: string, - icon?: React.Node, - style?: Object, - }, -} = { - verbose: { - label: 'Verbose', - color: colors.purple, - }, - debug: { - label: 'Debug', - color: colors.grey, - }, - info: { - label: 'Info', - icon: , - color: colors.cyan, - }, - warn: { - label: 'Warn', - style: { - backgroundColor: colors.yellowTint, - color: colors.yellow, - fontWeight: 500, - }, - icon: , - color: colors.yellow, - }, - error: { - label: 'Error', - style: { - backgroundColor: colors.redTint, - color: colors.red, - fontWeight: 500, - }, - icon: , - color: colors.red, - }, - fatal: { - label: 'Fatal', - style: { - backgroundColor: colors.redTint, - color: colors.red, - fontWeight: 700, - }, - icon: , - color: colors.red, - }, -}; - -const DEFAULT_FILTERS = [ - { - type: 'enum', - enum: Object.keys(LOG_TYPES).map(value => ({ - label: LOG_TYPES[value].label, - value, - })), - key: 'type', - value: [], - persistent: true, - }, -]; - -const NonSelectableText = Text.extends({ - alignSelf: 'baseline', - userSelect: 'none', - lineHeight: '130%', - marginTop: 6, -}); - -const LogCount = NonSelectableText.extends( - { - backgroundColor: props => props.color, - borderRadius: '999em', - fontSize: 11, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - marginTop: 4, - width: 16, - height: 16, - color: colors.white, - }, - { - ignoreAttributes: ['color'], - }, -); - -const HiddenScrollText = NonSelectableText.extends({ - '&::-webkit-scrollbar': { - display: 'none', - }, -}); - -function pad(chunk: mixed, len: number): string { - let str = String(chunk); - while (str.length < len) { - str = `0${str}`; - } - return str; -} - -export default class LogTable extends SonarDevicePlugin { - static id = 'DeviceLogs'; - static title = 'Logs'; - static icon = 'arrow-right'; - static keyboardActions = ['clear', 'goToBottom', 'createPaste']; - - onKeyboardAction = (action: string) => { - if (action === 'clear') { - this.clearLogs(); - } else if (action === 'goToBottom') { - this.goToBottom(); - } else if (action === 'createPaste') { - this.createPaste(); - } - }; - - restoreSavedCounters = (): Array => { - const savedCounters = - window.localStorage.getItem(LOG_WATCHER_LOCAL_STORAGE_KEY) || '[]'; - return JSON.parse(savedCounters).map((counter: Counter) => ({ - ...counter, - expression: new RegExp(counter.label, 'gi'), - count: 0, - })); - }; - - state = { - rows: [], - entries: [], - key2entry: {}, - initialising: true, - highlightedRows: [], - counters: this.restoreSavedCounters(), - }; - - tableRef: ?ManagedTable; - columns: TableColumns; - columnSizes: TableColumnSizes; - columnOrder: TableColumnOrder; - - init() { - let batch: Entries = []; - let queued = false; - let counter = 0; - - const supportedColumns = this.device.supportedColumns(); - this.columns = keepKeys(COLUMNS, supportedColumns); - this.columnSizes = keepKeys(COLUMN_SIZE, supportedColumns); - this.columnOrder = INITIAL_COLUMN_ORDER.filter(obj => - supportedColumns.includes(obj.key), - ); - - this.device.addLogListener((entry: DeviceLogEntry) => { - const {icon, style} = - LOG_TYPES[(entry.type: string)] || LOG_TYPES.verbose; - - // clean message - const message = entry.message.trim(); - entry.type === 'error'; - - let counterUpdated = false; - const counters = this.state.counters.map(counter => { - if (message.match(counter.expression)) { - counterUpdated = true; - if (counter.notify) { - new window.Notification(`${counter.label}`, { - body: 'The watched log message appeared', - }); - } - return { - ...counter, - count: counter.count + 1, - }; - } else { - return counter; - } - }); - if (counterUpdated) { - this.setState({counters}); - } - - // build the item, it will either be batched or added straight away - const item = { - entry, - row: { - columns: { - type: { - value: icon, - }, - time: { - value: ( - - {entry.date.toTimeString().split(' ')[0] + - '.' + - pad(entry.date.getMilliseconds(), 3)} - - ), - }, - message: { - value: {message}, - }, - tag: { - value: ( - {entry.tag} - ), - isFilterable: true, - }, - pid: { - value: ( - - {String(entry.pid)} - - ), - isFilterable: true, - }, - tid: { - value: ( - - {String(entry.tid)} - - ), - isFilterable: true, - }, - app: { - value: ( - {entry.app} - ), - isFilterable: true, - }, - }, - height: getLineCount(message) * 15 + 10, // 15px per line height + 8px padding - style, - type: entry.type, - filterValue: entry.message, - key: String(counter++), - }, - }; - - // batch up logs to be processed every 250ms, if we have lots of log - // messages coming in, then calling an setState 200+ times is actually - // pretty expensive - batch.push(item); - - if (!queued) { - queued = true; - - setTimeout(() => { - const thisBatch = batch; - batch = []; - queued = false; - - // update rows/entries - this.setState(state => { - const rows = [...state.rows]; - const entries = [...state.entries]; - const key2entry = {...state.key2entry}; - - for (let i = 0; i < thisBatch.length; i++) { - const {entry, row} = thisBatch[i]; - entries.push({row, entry}); - key2entry[row.key] = entry; - - let previousEntry: ?DeviceLogEntry = null; - - if (i > 0) { - previousEntry = thisBatch[i - 1].entry; - } else if (state.rows.length > 0 && state.entries.length > 0) { - previousEntry = state.entries[state.entries.length - 1].entry; - } - - this.addRowIfNeeded(rows, row, entry, previousEntry); - } - - return { - entries, - rows, - key2entry, - }; - }); - }, 100); - } - }); - - setTimeout(() => { - this.setState({ - initialising: false, - }); - }, 2000); - } - - addRowIfNeeded( - rows: Array, - row: TableBodyRow, - entry: DeviceLogEntry, - previousEntry: ?DeviceLogEntry, - ) { - const previousRow = rows.length > 0 ? rows[rows.length - 1] : null; - if ( - previousRow && - previousEntry && - entry.message === previousEntry.message && - entry.tag === previousEntry.tag && - previousRow.type != null - ) { - const count = (previousRow.columns.time.value.props.count || 1) + 1; - previousRow.columns.type.value = ( - {count} - ); - } else { - rows.push(row); - } - } - - clearLogs = () => { - this.setState({ - entries: [], - rows: [], - highlightedRows: [], - key2entry: {}, - counters: this.state.counters.map(counter => ({ - ...counter, - count: 0, - })), - }); - }; - - createPaste = () => { - let paste = ''; - const mapFn = row => - Object.keys(COLUMNS) - .map(key => textContent(row.columns[key].value)) - .join('\t'); - - if (this.state.highlightedRows.length > 0) { - // create paste from selection - paste = this.state.rows - .filter(row => this.state.highlightedRows.indexOf(row.key) > -1) - .map(mapFn) - .join('\n'); - } else { - // create paste with all rows - paste = this.state.rows.map(mapFn).join('\n'); - } - createPaste(paste); - }; - - setTableRef = (ref: React.ElementRef<*>) => { - this.tableRef = ref; - }; - - goToBottom = () => { - if (this.tableRef != null) { - this.tableRef.scrollToBottom(); - } - }; - - onRowHighlighted = (highlightedRows: Array) => { - this.setState({ - ...this.state, - highlightedRows, - }); - }; - - renderSidebar = () => { - return ( - - this.setState({counters}, () => - window.localStorage.setItem( - LOG_WATCHER_LOCAL_STORAGE_KEY, - JSON.stringify(this.state.counters), - ), - ) - } - /> - ); - }; - - static ContextMenu = ContextMenu.extends({ - flex: 1, - }); - - render() { - const {initialising, highlightedRows, rows} = this.state; - - const contextMenuItems = [ - { - type: 'separator', - }, - { - label: 'Clear all', - click: this.clearLogs, - }, - ]; - return initialising ? ( - - - - ) : ( - - Clear Logs} - /> - - ); - } -} diff --git a/src/device-plugins/logs/LogWatcher.js b/src/device-plugins/logs/LogWatcher.js index 5c005a348..f745e62bf 100644 --- a/src/device-plugins/logs/LogWatcher.js +++ b/src/device-plugins/logs/LogWatcher.js @@ -95,7 +95,8 @@ export default class LogWatcher extends PureComponent { onAdd = () => { if ( this.props.counters.findIndex(({label}) => label === this.state.input) > - -1 + -1 || + this.state.input.length === 0 ) { // prevent duplicates return; @@ -198,7 +199,11 @@ export default class LogWatcher extends PureComponent { onChange={this.onChange} onKeyDown={this.onSubmit} /> - + ; + +type LogsState = {| + initialising: boolean, + rows: Array, + entries: Entries, + key2entry: {[key: string]: DeviceLogEntry}, + highlightedRows: Array, + counters: Array, +|}; + +const Icon = Glyph.extends({ + marginTop: 5, +}); + +function getLineCount(str: string): number { + let count = 1; + for (let i = 0; i < str.length; i++) { + if (str[i] === '\n') { + count++; + } + } + return count; +} + +function keepKeys(obj, keys) { + const result = {}; + for (const key in obj) { + if (keys.includes(key)) { + result[key] = obj[key]; + } + } + return result; +} + +const COLUMN_SIZE = { + type: 32, + time: 120, + pid: 60, + tid: 60, + tag: 120, + app: 200, + message: 'flex', +}; + +const COLUMNS = { + type: { + value: '', + }, + time: { + value: 'Time', + }, + pid: { + value: 'PID', + }, + tid: { + value: 'TID', + }, + tag: { + value: 'Tag', + }, + app: { + value: 'App', + }, + message: { + value: 'Message', + }, +}; + +const INITIAL_COLUMN_ORDER = [ + { + key: 'type', + visible: true, + }, + { + key: 'time', + visible: false, + }, + { + key: 'pid', + visible: false, + }, + { + key: 'tid', + visible: false, + }, + { + key: 'tag', + visible: true, + }, + { + key: 'app', + visible: true, + }, + { + key: 'message', + visible: true, + }, +]; + +const LOG_TYPES: { + [level: string]: { + label: string, + color: string, + icon?: React.Node, + style?: Object, + }, +} = { + verbose: { + label: 'Verbose', + color: colors.purple, + }, + debug: { + label: 'Debug', + color: colors.grey, + }, + info: { + label: 'Info', + icon: , + color: colors.cyan, + }, + warn: { + label: 'Warn', + style: { + backgroundColor: colors.yellowTint, + color: colors.yellow, + fontWeight: 500, + }, + icon: , + color: colors.yellow, + }, + error: { + label: 'Error', + style: { + backgroundColor: colors.redTint, + color: colors.red, + fontWeight: 500, + }, + icon: , + color: colors.red, + }, + fatal: { + label: 'Fatal', + style: { + backgroundColor: colors.redTint, + color: colors.red, + fontWeight: 700, + }, + icon: , + color: colors.red, + }, +}; + +const DEFAULT_FILTERS = [ + { + type: 'enum', + enum: Object.keys(LOG_TYPES).map(value => ({ + label: LOG_TYPES[value].label, + value, + })), + key: 'type', + value: [], + persistent: true, + }, +]; + +const NonSelectableText = Text.extends({ + alignSelf: 'baseline', + userSelect: 'none', + lineHeight: '130%', + marginTop: 6, +}); + +const LogCount = NonSelectableText.extends( + { + backgroundColor: props => props.color, + borderRadius: '999em', + fontSize: 11, + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + marginTop: 4, + width: 16, + height: 16, + color: colors.white, + }, + { + ignoreAttributes: ['color'], + }, +); + +const HiddenScrollText = NonSelectableText.extends({ + '&::-webkit-scrollbar': { + display: 'none', + }, +}); + +function pad(chunk: mixed, len: number): string { + let str = String(chunk); + while (str.length < len) { + str = `0${str}`; + } + return str; +} + +export default class LogTable extends SonarDevicePlugin { + static id = 'DeviceLogs'; + static title = 'Logs'; + static icon = 'arrow-right'; + static keyboardActions = ['clear', 'goToBottom', 'createPaste']; + + onKeyboardAction = (action: string) => { + if (action === 'clear') { + this.clearLogs(); + } else if (action === 'goToBottom') { + this.goToBottom(); + } else if (action === 'createPaste') { + this.createPaste(); + } + }; + + restoreSavedCounters = (): Array => { + const savedCounters = + window.localStorage.getItem(LOG_WATCHER_LOCAL_STORAGE_KEY) || '[]'; + return JSON.parse(savedCounters).map((counter: Counter) => ({ + ...counter, + expression: new RegExp(counter.label, 'gi'), + count: 0, + })); + }; + + state = { + rows: [], + entries: [], + key2entry: {}, + initialising: true, + highlightedRows: [], + counters: this.restoreSavedCounters(), + }; + + tableRef: ?ManagedTable; + columns: TableColumns; + columnSizes: TableColumnSizes; + columnOrder: TableColumnOrder; + + init() { + let batch: Entries = []; + let queued = false; + let counter = 0; + + const supportedColumns = this.device.supportedColumns(); + this.columns = keepKeys(COLUMNS, supportedColumns); + this.columnSizes = keepKeys(COLUMN_SIZE, supportedColumns); + this.columnOrder = INITIAL_COLUMN_ORDER.filter(obj => + supportedColumns.includes(obj.key), + ); + + this.device.addLogListener((entry: DeviceLogEntry) => { + const {icon, style} = + LOG_TYPES[(entry.type: string)] || LOG_TYPES.verbose; + + // clean message + const message = entry.message.trim(); + entry.type === 'error'; + + let counterUpdated = false; + const counters = this.state.counters.map(counter => { + if (message.match(counter.expression)) { + counterUpdated = true; + if (counter.notify) { + new window.Notification(`${counter.label}`, { + body: 'The watched log message appeared', + }); + } + return { + ...counter, + count: counter.count + 1, + }; + } else { + return counter; + } + }); + if (counterUpdated) { + this.setState({counters}); + } + + // build the item, it will either be batched or added straight away + const item = { + entry, + row: { + columns: { + type: { + value: icon, + }, + time: { + value: ( + + {entry.date.toTimeString().split(' ')[0] + + '.' + + pad(entry.date.getMilliseconds(), 3)} + + ), + }, + message: { + value: {message}, + }, + tag: { + value: ( + {entry.tag} + ), + isFilterable: true, + }, + pid: { + value: ( + + {String(entry.pid)} + + ), + isFilterable: true, + }, + tid: { + value: ( + + {String(entry.tid)} + + ), + isFilterable: true, + }, + app: { + value: ( + {entry.app} + ), + isFilterable: true, + }, + }, + height: getLineCount(message) * 15 + 10, // 15px per line height + 8px padding + style, + type: entry.type, + filterValue: entry.message, + key: String(counter++), + }, + }; + + // batch up logs to be processed every 250ms, if we have lots of log + // messages coming in, then calling an setState 200+ times is actually + // pretty expensive + batch.push(item); + + if (!queued) { + queued = true; + + setTimeout(() => { + const thisBatch = batch; + batch = []; + queued = false; + + // update rows/entries + this.setState(state => { + const rows = [...state.rows]; + const entries = [...state.entries]; + const key2entry = {...state.key2entry}; + + for (let i = 0; i < thisBatch.length; i++) { + const {entry, row} = thisBatch[i]; + entries.push({row, entry}); + key2entry[row.key] = entry; + + let previousEntry: ?DeviceLogEntry = null; + + if (i > 0) { + previousEntry = thisBatch[i - 1].entry; + } else if (state.rows.length > 0 && state.entries.length > 0) { + previousEntry = state.entries[state.entries.length - 1].entry; + } + + this.addRowIfNeeded(rows, row, entry, previousEntry); + } + + return { + entries, + rows, + key2entry, + }; + }); + }, 100); + } + }); + + setTimeout(() => { + this.setState({ + initialising: false, + }); + }, 2000); + } + + addRowIfNeeded( + rows: Array, + row: TableBodyRow, + entry: DeviceLogEntry, + previousEntry: ?DeviceLogEntry, + ) { + const previousRow = rows.length > 0 ? rows[rows.length - 1] : null; + if ( + previousRow && + previousEntry && + entry.message === previousEntry.message && + entry.tag === previousEntry.tag && + previousRow.type != null + ) { + const count = (previousRow.columns.time.value.props.count || 1) + 1; + previousRow.columns.type.value = ( + {count} + ); + } else { + rows.push(row); + } + } + + clearLogs = () => { + this.setState({ + entries: [], + rows: [], + highlightedRows: [], + key2entry: {}, + counters: this.state.counters.map(counter => ({ + ...counter, + count: 0, + })), + }); + }; + + createPaste = () => { + let paste = ''; + const mapFn = row => + Object.keys(COLUMNS) + .map(key => textContent(row.columns[key].value)) + .join('\t'); + + if (this.state.highlightedRows.length > 0) { + // create paste from selection + paste = this.state.rows + .filter(row => this.state.highlightedRows.indexOf(row.key) > -1) + .map(mapFn) + .join('\n'); + } else { + // create paste with all rows + paste = this.state.rows.map(mapFn).join('\n'); + } + createPaste(paste); + }; + + setTableRef = (ref: React.ElementRef<*>) => { + this.tableRef = ref; + }; + + goToBottom = () => { + if (this.tableRef != null) { + this.tableRef.scrollToBottom(); + } + }; + + onRowHighlighted = (highlightedRows: Array) => { + this.setState({ + ...this.state, + highlightedRows, + }); + }; + + renderSidebar = () => { + return ( + + this.setState({counters}, () => + window.localStorage.setItem( + LOG_WATCHER_LOCAL_STORAGE_KEY, + JSON.stringify(this.state.counters), + ), + ) + } + /> + ); + }; + + static ContextMenu = ContextMenu.extends({ + flex: 1, + }); + + render() { + const {initialising, rows} = this.state; + + const contextMenuItems = [ + { + type: 'separator', + }, + { + label: 'Clear all', + click: this.clearLogs, + }, + ]; + return initialising ? ( + + + + ) : ( + + Clear Logs} + /> + + ); + } +} diff --git a/src/dispatcher/iOSDevice.js b/src/dispatcher/iOSDevice.js index 74070c24e..da9f9a5ad 100644 --- a/src/dispatcher/iOSDevice.js +++ b/src/dispatcher/iOSDevice.js @@ -35,16 +35,14 @@ function querySimulatorDevices(): Promise { {encoding: 'utf8'}, (err, stdout) => { if (err) { - console.error('Failed to load iOS devices', err); - return resolve({}); + reject(err); } try { const {devices} = JSON.parse(stdout.toString()); resolve(devices); } catch (err) { - console.error('Failed to parse iOS device list', err); - resolve({}); + reject(err); } }, ); @@ -56,44 +54,54 @@ export default (store: Store) => { if (process.platform !== 'darwin') { return; } - setInterval(() => { + let simulatorUpdateInterval = setInterval(() => { const {devices} = store.getState(); - querySimulatorDevices().then((simulatorDevices: IOSDeviceMap) => { - const simulators: Array = Object.values( - simulatorDevices, - // $FlowFixMe - ).reduce((acc, cv) => acc.concat(cv), []); + clearInterval(simulatorUpdateInterval); + querySimulatorDevices() + .then((simulatorDevices: IOSDeviceMap) => { + const simulators: Array = Object.values( + simulatorDevices, + // $FlowFixMe + ).reduce((acc, cv) => acc.concat(cv), []); - const currentDeviceIDs: Set = new Set( - devices - .filter(device => device instanceof IOSDevice) - .map(device => device.serial), - ); + const currentDeviceIDs: Set = new Set( + devices + .filter(device => device instanceof IOSDevice) + .map(device => device.serial), + ); - const deviceIDsToRemove = new Set(); - simulators.forEach((simulator: iOSSimulatorDevice) => { - const isRunning = - simulator.state === 'Booted' && - simulator.availability === '(available)'; + const deviceIDsToRemove = new Set(); + simulators.forEach((simulator: iOSSimulatorDevice) => { + const isRunning = + simulator.state === 'Booted' && + simulator.availability === '(available)'; - if (isRunning && !currentDeviceIDs.has(simulator.udid)) { - // create device - store.dispatch({ - type: 'REGISTER_DEVICE', - payload: new IOSDevice(simulator.udid, 'emulator', simulator.name), - }); - } else if (!isRunning && currentDeviceIDs.has(simulator.udid)) { - deviceIDsToRemove.add(simulator.udid); - // delete device - } - }); - - if (deviceIDsToRemove.size > 0) { - store.dispatch({ - type: 'UNREGISTER_DEVICES', - payload: deviceIDsToRemove, + if (isRunning && !currentDeviceIDs.has(simulator.udid)) { + // create device + store.dispatch({ + type: 'REGISTER_DEVICE', + payload: new IOSDevice( + simulator.udid, + 'emulator', + simulator.name, + ), + }); + } else if (!isRunning && currentDeviceIDs.has(simulator.udid)) { + deviceIDsToRemove.add(simulator.udid); + // delete device + } }); - } - }); + + if (deviceIDsToRemove.size > 0) { + store.dispatch({ + type: 'UNREGISTER_DEVICES', + payload: deviceIDsToRemove, + }); + } + }) + .catch(err => { + console.error(err); + clearInterval(simulatorUpdateInterval); + }); }, 3000); }; diff --git a/src/server.js b/src/server.js index eeb62e9e1..886ca1313 100644 --- a/src/server.js +++ b/src/server.js @@ -152,7 +152,7 @@ export class Client extends EventEmitter { try { rawData = JSON.parse(msg); } catch (err) { - this.app.logger.error(`Invalid JSON: ${msg}`, 'clientMessage'); + console.error(`Invalid JSON: ${msg}`, 'clientMessage'); return; } @@ -164,14 +164,14 @@ export class Client extends EventEmitter { error?: Object, |} = rawData; - this.app.logger.info(data, 'message:receive'); + console.log(data, 'message:receive'); const {id, method} = data; if (id == null) { const {error} = data; if (error != null) { - this.app.logger.error( + console.error( `Error received from device ${ method ? `when calling ${method}` : '' }: ${error.message} + \nDevice Stack Trace: ${error.stacktrace}`, @@ -266,7 +266,7 @@ export class Client extends EventEmitter { params, }; - this.app.logger.info(data, 'message:call'); + console.log(data, 'message:call'); this.startTimingRequestResponse({method, id, params}); this.connection.fireAndForget({data: JSON.stringify(data)}); }); @@ -299,7 +299,7 @@ export class Client extends EventEmitter { method, params, }; - this.app.logger.info(data, 'message:send'); + console.log(data, 'message:send'); this.connection.fireAndForget({data: JSON.stringify(data)}); } @@ -335,7 +335,7 @@ export class Server extends EventEmitter { init() { if (process.env.NODE_ENV === 'test') { - this.app.logger.warn( + console.warn( "rsocket server has not been started as we're in test mode", 'server', ); @@ -361,13 +361,13 @@ export class Server extends EventEmitter { transportServer .on('error', err => { server.emit('error', err); - server.app.logger.error( + console.error( `Error opening server on port ${port}`, 'server', ); }) .on('listening', () => { - server.app.logger.warn( + console.warn( `${ sslConfig ? 'Secure' : 'Certificate' } server started on port ${port}`, @@ -401,7 +401,7 @@ export class Server extends EventEmitter { conn.connectionStatus().subscribe({ onNext(payload) { if (payload.kind == 'ERROR' || payload.kind == 'CLOSED') { - server.app.logger.warn( + console.warn( `Device disconnected ${client.id}`, 'connection', ); @@ -433,7 +433,7 @@ export class Server extends EventEmitter { try { rawData = JSON.parse(payload.data); } catch (err) { - this.app.logger.error( + console.error( `Invalid JSON: ${payload.data}`, 'clientMessage', ); @@ -446,7 +446,7 @@ export class Server extends EventEmitter { destination: string, |} = rawData; if (json.method === 'signCertificate') { - this.app.logger.warn('CSR received from device', 'server'); + console.warn('CSR received from device', 'server'); const {csr, destination} = json; this.certificateProvider.processCertificateSigningRequest( csr, @@ -471,7 +471,7 @@ export class Server extends EventEmitter { invariant(query, 'expected query'); const id = `${query.app}-${query.os}-${query.device}`; - this.app.logger.warn(`Device connected: ${id}`, 'connection'); + console.warn(`Device connected: ${id}`, 'connection'); const client = new Client(this.app, id, query, conn); @@ -481,7 +481,7 @@ export class Server extends EventEmitter { }; client.init().then(() => { - this.app.logger.info( + console.log( `Device client initialised: ${id}. Supported plugins: ${client.plugins.join( ', ', )}`, @@ -547,7 +547,7 @@ class ConnectionTracker { this.connectionAttempts.set(key, entry); if (entry.length >= this.connectionProblemThreshold) { - this.logger.error( + console.error( `Connection loop detected with ${key}. Connected ${ entry.length } times in ${(time - entry[0]) / 1000}s.`, diff --git a/src/ui/components/ErrorBoundary.js b/src/ui/components/ErrorBoundary.js index 5c324dbbf..683b49e4d 100644 --- a/src/ui/components/ErrorBoundary.js +++ b/src/ui/components/ErrorBoundary.js @@ -44,7 +44,7 @@ export default class ErrorBoundary extends Component< componentDidCatch(err: Error) { this.props.logger && - this.props.logger.error(err.toString(), 'ErrorBoundary'); + console.error(err.toString(), 'ErrorBoundary'); this.setState({error: err}); } diff --git a/src/utils/CertificateProvider.js b/src/utils/CertificateProvider.js index bbf61d818..80477c747 100644 --- a/src/utils/CertificateProvider.js +++ b/src/utils/CertificateProvider.js @@ -131,7 +131,7 @@ export default class CertificateProvider { } generateClientCertificate(csr: string): Promise { - this.logger.warn('Creating new client cert', logTag); + console.warn('Creating new client cert', logTag); const csrFile = this.writeToTempFile(csr); // Create a certificate for the client, using the details in the CSR. return openssl('x509', { @@ -197,7 +197,7 @@ export default class CertificateProvider { return {id: device.id, isMatch}; }) .catch(e => { - this.logger.error( + console.error( `Unable to check for matching CSR in ${device.id}:${appName}`, logTag, ); @@ -234,7 +234,7 @@ export default class CertificateProvider { ); }) .catch(err => { - this.logger.error(err, logTag); + console.error(err, logTag); return false; }); } @@ -245,7 +245,7 @@ export default class CertificateProvider { filename: string, contents: string, ): Promise { - this.logger.warn(`Deploying ${filename} to ${deviceId}:${app}`, logTag); + console.warn(`Deploying ${filename} to ${deviceId}:${app}`, logTag); return this.executeCommandOnAndroid( deviceId, app, @@ -282,11 +282,11 @@ export default class CertificateProvider { return output; }) .catch(err => { - this.logger.error( + console.error( `Error executing command on android device ${deviceId}:${user}. Command: ${command}`, logTag, ); - this.logger.error(err, logTag); + console.error(err, logTag); }); } @@ -351,7 +351,7 @@ export default class CertificateProvider { }) .then(output => undefined) .catch(e => { - this.logger.warn(`Certificate will expire soon: ${filename}`, logTag); + console.warn(`Certificate will expire soon: ${filename}`, logTag); throw e; }); } @@ -373,7 +373,7 @@ export default class CertificateProvider { if (!fs.existsSync(getFilePath(''))) { fs.mkdirSync(getFilePath('')); } - this.logger.info('Generating new CA', logTag); + console.log('Generating new CA', logTag); return openssl('genrsa', {out: caKey, '2048': false}) .then(_ => openssl('req', { @@ -406,7 +406,7 @@ export default class CertificateProvider { generateServerCertificate(): Promise { return this.ensureCertificateAuthorityExists() .then(_ => { - this.logger.warn('Creating new server cert', logTag); + console.warn('Creating new server cert', logTag); }) .then(_ => openssl('genrsa', {out: serverKey, '2048': false})) .then(_ => diff --git a/xplat/Sonar/SonarClient.cpp b/xplat/Sonar/SonarClient.cpp index 2bd1c2ed1..a7d88ee09 100644 --- a/xplat/Sonar/SonarClient.cpp +++ b/xplat/Sonar/SonarClient.cpp @@ -16,7 +16,7 @@ #define SONAR_LOG(message) \ __android_log_print(ANDROID_LOG_INFO, "sonar", "sonar: %s", message) #else -#define SONAR_LOG(message) printf("sonar: %s", message) +#define SONAR_LOG(message) printf("sonar: %s\n", message) #endif #if FB_SONARKIT_ENABLED diff --git a/xplat/Sonar/SonarWebSocketImpl.cpp b/xplat/Sonar/SonarWebSocketImpl.cpp index fe9f5d12f..343aa7956 100644 --- a/xplat/Sonar/SonarWebSocketImpl.cpp +++ b/xplat/Sonar/SonarWebSocketImpl.cpp @@ -26,7 +26,7 @@ #define SONAR_LOG(message) \ __android_log_print(ANDROID_LOG_INFO, "sonar", "sonar: %s", message) #else -#define SONAR_LOG(message) printf("sonar: %s", message) +#define SONAR_LOG(message) printf("sonar: %s\n", message) #endif #define CSR_FILE_NAME "app.csr" @@ -99,7 +99,7 @@ SonarWebSocketImpl::~SonarWebSocketImpl() { void SonarWebSocketImpl::start() { folly::makeFuture() .via(worker_->getEventBase()) - .delayed(std::chrono::milliseconds(0)) + .delayedUnsafe(std::chrono::milliseconds(0)) .then([this]() { startSync(); }); } @@ -185,7 +185,7 @@ void SonarWebSocketImpl::connectSecurely() { void SonarWebSocketImpl::reconnect() { folly::makeFuture() .via(worker_->getEventBase()) - .delayed(std::chrono::seconds(reconnectIntervalSeconds)) + .delayedUnsafe(std::chrono::seconds(reconnectIntervalSeconds)) .then([this]() { startSync(); }); }