@onekeyfe/react-native-native-logger 3.0.81 → 3.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.cpp +26 -24
  2. package/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.hpp +20 -22
  3. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/HybridNativeLoggerSpec.kt +16 -19
  4. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/nativeloggerOnLoad.kt +1 -1
  5. package/nitrogen/generated/android/nativelogger+autolinking.cmake +1 -1
  6. package/nitrogen/generated/android/nativelogger+autolinking.gradle +1 -1
  7. package/nitrogen/generated/android/nativeloggerOnLoad.cpp +27 -17
  8. package/nitrogen/generated/android/nativeloggerOnLoad.hpp +14 -5
  9. package/nitrogen/generated/ios/ReactNativeNativeLogger+autolinking.rb +2 -2
  10. package/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp +1 -1
  11. package/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp +1 -1
  12. package/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp +1 -1
  13. package/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.mm +1 -1
  14. package/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.swift +9 -8
  15. package/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.cpp +1 -1
  16. package/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.hpp +7 -1
  17. package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
  18. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -2
  19. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +1 -2
  20. package/nitrogen/generated/ios/swift/HybridNativeLoggerSpec.swift +3 -4
  21. package/nitrogen/generated/ios/swift/HybridNativeLoggerSpec_cxx.swift +9 -2
  22. package/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.cpp +1 -1
  23. package/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.hpp +1 -1
  24. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
  /// JHybridNativeLoggerSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "JHybridNativeLoggerSpec.hpp"
@@ -13,33 +13,35 @@
13
13
  #include <vector>
14
14
  #include <NitroModules/Promise.hpp>
15
15
  #include <NitroModules/JPromise.hpp>
16
+ #include <NitroModules/JUnit.hpp>
16
17
 
17
18
  namespace margelo::nitro::nativelogger {
18
19
 
19
- jni::local_ref<JHybridNativeLoggerSpec::jhybriddata> JHybridNativeLoggerSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
20
- return makeCxxInstance(jThis);
21
- }
22
-
23
- void JHybridNativeLoggerSpec::registerNatives() {
24
- registerHybrid({
25
- makeNativeMethod("initHybrid", JHybridNativeLoggerSpec::initHybrid),
26
- });
20
+ std::shared_ptr<JHybridNativeLoggerSpec> JHybridNativeLoggerSpec::JavaPart::getJHybridNativeLoggerSpec() {
21
+ auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
22
+ auto castHybridObject = std::dynamic_pointer_cast<JHybridNativeLoggerSpec>(hybridObject);
23
+ if (castHybridObject == nullptr) [[unlikely]] {
24
+ throw std::runtime_error("Failed to downcast JHybridObject to JHybridNativeLoggerSpec!");
25
+ }
26
+ return castHybridObject;
27
27
  }
28
28
 
29
- size_t JHybridNativeLoggerSpec::getExternalMemorySize() noexcept {
30
- static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
31
- return method(_javaPart);
29
+ jni::local_ref<JHybridNativeLoggerSpec::CxxPart::jhybriddata> JHybridNativeLoggerSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
30
+ return makeCxxInstance(jThis);
32
31
  }
33
32
 
34
- void JHybridNativeLoggerSpec::dispose() noexcept {
35
- static const auto method = javaClassStatic()->getMethod<void()>("dispose");
36
- method(_javaPart);
33
+ std::shared_ptr<JHybridObject> JHybridNativeLoggerSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
34
+ auto castJavaPart = jni::dynamic_ref_cast<JHybridNativeLoggerSpec::JavaPart>(javaPart);
35
+ if (castJavaPart == nullptr) [[unlikely]] {
36
+ throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridNativeLoggerSpec::JavaPart!");
37
+ }
38
+ return std::make_shared<JHybridNativeLoggerSpec>(castJavaPart);
37
39
  }
38
40
 
39
- std::string JHybridNativeLoggerSpec::toString() {
40
- static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
41
- auto javaString = method(_javaPart);
42
- return javaString->toStdString();
41
+ void JHybridNativeLoggerSpec::CxxPart::registerNatives() {
42
+ registerHybrid({
43
+ makeNativeMethod("initHybrid", JHybridNativeLoggerSpec::CxxPart::initHybrid),
44
+ });
43
45
  }
44
46
 
45
47
  // Properties
@@ -47,20 +49,20 @@ namespace margelo::nitro::nativelogger {
47
49
 
48
50
  // Methods
49
51
  void JHybridNativeLoggerSpec::write(double level, const std::string& msg) {
50
- static const auto method = javaClassStatic()->getMethod<void(double /* level */, jni::alias_ref<jni::JString> /* msg */)>("write");
52
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* level */, jni::alias_ref<jni::JString> /* msg */)>("write");
51
53
  method(_javaPart, level, jni::make_jstring(msg));
52
54
  }
53
55
  void JHybridNativeLoggerSpec::flushPendingRepeat() {
54
- static const auto method = javaClassStatic()->getMethod<void()>("flushPendingRepeat");
56
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void()>("flushPendingRepeat");
55
57
  method(_javaPart);
56
58
  }
57
59
  std::string JHybridNativeLoggerSpec::getLogDirectory() {
58
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getLogDirectory");
60
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getLogDirectory");
59
61
  auto __result = method(_javaPart);
60
62
  return __result->toStdString();
61
63
  }
62
64
  std::shared_ptr<Promise<std::vector<std::string>>> JHybridNativeLoggerSpec::getLogFilePaths() {
63
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getLogFilePaths");
65
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getLogFilePaths");
64
66
  auto __result = method(_javaPart);
65
67
  return [&]() {
66
68
  auto __promise = Promise<std::vector<std::string>>::create();
@@ -85,7 +87,7 @@ namespace margelo::nitro::nativelogger {
85
87
  }();
86
88
  }
87
89
  std::shared_ptr<Promise<void>> JHybridNativeLoggerSpec::deleteLogFiles() {
88
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("deleteLogFiles");
90
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("deleteLogFiles");
89
91
  auto __result = method(_javaPart);
90
92
  return [&]() {
91
93
  auto __promise = Promise<void>::create();
@@ -2,7 +2,7 @@
2
2
  /// HybridNativeLoggerSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -18,33 +18,33 @@ namespace margelo::nitro::nativelogger {
18
18
 
19
19
  using namespace facebook;
20
20
 
21
- class JHybridNativeLoggerSpec: public jni::HybridClass<JHybridNativeLoggerSpec, JHybridObject>,
22
- public virtual HybridNativeLoggerSpec {
21
+ class JHybridNativeLoggerSpec: public virtual HybridNativeLoggerSpec, public virtual JHybridObject {
23
22
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nativelogger/HybridNativeLoggerSpec;";
25
- static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
26
- static void registerNatives();
27
-
28
- protected:
29
- // C++ constructor (called from Java via `initHybrid()`)
30
- explicit JHybridNativeLoggerSpec(jni::alias_ref<jhybridobject> jThis) :
31
- HybridObject(HybridNativeLoggerSpec::TAG),
32
- HybridBase(jThis),
33
- _javaPart(jni::make_global(jThis)) {}
23
+ struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nativelogger/HybridNativeLoggerSpec;";
25
+ std::shared_ptr<JHybridNativeLoggerSpec> getJHybridNativeLoggerSpec();
26
+ };
27
+ struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
28
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nativelogger/HybridNativeLoggerSpec$CxxPart;";
29
+ static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
30
+ static void registerNatives();
31
+ using HybridBase::HybridBase;
32
+ protected:
33
+ std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
34
+ };
34
35
 
35
36
  public:
37
+ explicit JHybridNativeLoggerSpec(const jni::local_ref<JHybridNativeLoggerSpec::JavaPart>& javaPart):
38
+ HybridObject(HybridNativeLoggerSpec::TAG),
39
+ JHybridObject(javaPart),
40
+ _javaPart(jni::make_global(javaPart)) {}
36
41
  ~JHybridNativeLoggerSpec() override {
37
42
  // Hermes GC can destroy JS objects on a non-JNI Thread.
38
43
  jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
39
44
  }
40
45
 
41
46
  public:
42
- size_t getExternalMemorySize() noexcept override;
43
- void dispose() noexcept override;
44
- std::string toString() override;
45
-
46
- public:
47
- inline const jni::global_ref<JHybridNativeLoggerSpec::javaobject>& getJavaPart() const noexcept {
47
+ inline const jni::global_ref<JHybridNativeLoggerSpec::JavaPart>& getJavaPart() const noexcept {
48
48
  return _javaPart;
49
49
  }
50
50
 
@@ -61,9 +61,7 @@ namespace margelo::nitro::nativelogger {
61
61
  std::shared_ptr<Promise<void>> deleteLogFiles() override;
62
62
 
63
63
  private:
64
- friend HybridBase;
65
- using HybridBase::HybridBase;
66
- jni::global_ref<JHybridNativeLoggerSpec::javaobject> _javaPart;
64
+ jni::global_ref<JHybridNativeLoggerSpec::JavaPart> _javaPart;
67
65
  };
68
66
 
69
67
  } // namespace margelo::nitro::nativelogger
@@ -2,7 +2,7 @@
2
2
  /// HybridNativeLoggerSpec.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.nativelogger
@@ -25,23 +25,6 @@ import com.margelo.nitro.core.HybridObject
25
25
  "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
26
26
  )
27
27
  abstract class HybridNativeLoggerSpec: HybridObject() {
28
- @DoNotStrip
29
- private var mHybridData: HybridData = initHybrid()
30
-
31
- init {
32
- super.updateNative(mHybridData)
33
- }
34
-
35
- override fun updateNative(hybridData: HybridData) {
36
- mHybridData = hybridData
37
- super.updateNative(hybridData)
38
- }
39
-
40
- // Default implementation of `HybridObject.toString()`
41
- override fun toString(): String {
42
- return "[HybridObject NativeLogger]"
43
- }
44
-
45
28
  // Properties
46
29
 
47
30
 
@@ -66,7 +49,21 @@ abstract class HybridNativeLoggerSpec: HybridObject() {
66
49
  @Keep
67
50
  abstract fun deleteLogFiles(): Promise<Unit>
68
51
 
69
- private external fun initHybrid(): HybridData
52
+ // Default implementation of `HybridObject.toString()`
53
+ override fun toString(): String {
54
+ return "[HybridObject NativeLogger]"
55
+ }
56
+
57
+ // C++ backing class
58
+ @DoNotStrip
59
+ @Keep
60
+ protected open class CxxPart(javaPart: HybridNativeLoggerSpec): HybridObject.CxxPart(javaPart) {
61
+ // C++ JHybridNativeLoggerSpec::CxxPart::initHybrid(...)
62
+ external override fun initHybrid(): HybridData
63
+ }
64
+ override fun createCxxPart(): CxxPart {
65
+ return CxxPart(this)
66
+ }
70
67
 
71
68
  companion object {
72
69
  protected const val TAG = "HybridNativeLoggerSpec"
@@ -2,7 +2,7 @@
2
2
  /// nativeloggerOnLoad.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.nativelogger
@@ -2,7 +2,7 @@
2
2
  # nativelogger+autolinking.cmake
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2026 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a CMake file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// nativelogger+autolinking.gradle
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /// This is a Gradle file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// nativeloggerOnLoad.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #ifndef BUILDING_NATIVELOGGER_WITH_GENERATED_CMAKE_PROJECT
@@ -21,24 +21,34 @@
21
21
  namespace margelo::nitro::nativelogger {
22
22
 
23
23
  int initialize(JavaVM* vm) {
24
+ return facebook::jni::initialize(vm, []() {
25
+ ::margelo::nitro::nativelogger::registerAllNatives();
26
+ });
27
+ }
28
+
29
+ struct JHybridNativeLoggerSpecImpl: public jni::JavaClass<JHybridNativeLoggerSpecImpl, JHybridNativeLoggerSpec::JavaPart> {
30
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nativelogger/NativeLogger;";
31
+ static std::shared_ptr<JHybridNativeLoggerSpec> create() {
32
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNativeLoggerSpecImpl::javaobject()>();
33
+ jni::local_ref<JHybridNativeLoggerSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
34
+ return javaPart->getJHybridNativeLoggerSpec();
35
+ }
36
+ };
37
+
38
+ void registerAllNatives() {
24
39
  using namespace margelo::nitro;
25
40
  using namespace margelo::nitro::nativelogger;
26
- using namespace facebook;
27
-
28
- return facebook::jni::initialize(vm, [] {
29
- // Register native JNI methods
30
- margelo::nitro::nativelogger::JHybridNativeLoggerSpec::registerNatives();
31
-
32
- // Register Nitro Hybrid Objects
33
- HybridObjectRegistry::registerHybridObjectConstructor(
34
- "NativeLogger",
35
- []() -> std::shared_ptr<HybridObject> {
36
- static DefaultConstructableObject<JHybridNativeLoggerSpec::javaobject> object("com/margelo/nitro/nativelogger/NativeLogger");
37
- auto instance = object.create();
38
- return instance->cthis()->shared();
39
- }
40
- );
41
- });
41
+
42
+ // Register native JNI methods
43
+ margelo::nitro::nativelogger::JHybridNativeLoggerSpec::CxxPart::registerNatives();
44
+
45
+ // Register Nitro Hybrid Objects
46
+ HybridObjectRegistry::registerHybridObjectConstructor(
47
+ "NativeLogger",
48
+ []() -> std::shared_ptr<HybridObject> {
49
+ return JHybridNativeLoggerSpecImpl::create();
50
+ }
51
+ );
42
52
  }
43
53
 
44
54
  } // namespace margelo::nitro::nativelogger
@@ -2,24 +2,33 @@
2
2
  /// nativeloggerOnLoad.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include <jni.h>
9
+ #include <functional>
9
10
  #include <NitroModules/NitroDefines.hpp>
10
11
 
11
12
  namespace margelo::nitro::nativelogger {
12
13
 
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
13
17
  /**
14
- * Initializes the native (C++) part of nativelogger, and autolinks all Hybrid Objects.
15
- * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
18
+ * Register the native (C++) part of nativelogger, and autolinks all Hybrid Objects.
19
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
20
+ * inside a `facebook::jni::initialize(vm, ...)` call.
16
21
  * Example:
17
22
  * ```cpp (cpp-adapter.cpp)
18
23
  * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
19
- * return margelo::nitro::nativelogger::initialize(vm);
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all nativelogger HybridObjects
26
+ * margelo::nitro::nativelogger::registerNatives();
27
+ * // any other custom registrations go here.
28
+ * });
20
29
  * }
21
30
  * ```
22
31
  */
23
- int initialize(JavaVM* vm);
32
+ void registerAllNatives();
24
33
 
25
34
  } // namespace margelo::nitro::nativelogger
@@ -2,7 +2,7 @@
2
2
  # ReactNativeNativeLogger+autolinking.rb
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2026 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a Ruby script that adds all files generated by Nitrogen
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
52
52
  spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
53
  # Use C++ 20
54
54
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
- # Enables C++ <-> Swift interop (by default it's only C)
55
+ # Enables C++ <-> Swift interop (by default it's only ObjC)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp"
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeNativeLoggerAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,19 +2,16 @@
2
2
  /// ReactNativeNativeLoggerAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import NitroModules
9
+
10
+ // TODO: Use empty enums once Swift supports exporting them as namespaces
11
+ // See: https://github.com/swiftlang/swift/pull/83616
8
12
  public final class ReactNativeNativeLoggerAutolinking {
9
13
  public typealias bridge = margelo.nitro.nativelogger.bridge.swift
10
14
 
11
- /**
12
- * Creates an instance of a Swift class that implements `HybridNativeLoggerSpec`,
13
- * and wraps it in a Swift class that can directly interop with C++ (`HybridNativeLoggerSpec_cxx`)
14
- *
15
- * This is generated by Nitrogen and will initialize the class specified
16
- * in the `"autolinking"` property of `nitro.json` (in this case, `NativeLogger`).
17
- */
18
15
  public static func createNativeLogger() -> bridge.std__shared_ptr_HybridNativeLoggerSpec_ {
19
16
  let hybridObject = NativeLogger()
20
17
  return { () -> bridge.std__shared_ptr_HybridNativeLoggerSpec_ in
@@ -22,4 +19,8 @@ public final class ReactNativeNativeLoggerAutolinking {
22
19
  return __cxxWrapped.getCxxPart()
23
20
  }()
24
21
  }
22
+
23
+ public static func isNativeLoggerRecyclable() -> Bool {
24
+ return NativeLogger.self is any RecyclableView.Type
25
+ }
25
26
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridNativeLoggerSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridNativeLoggerSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridNativeLoggerSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -49,6 +49,12 @@ namespace margelo::nitro::nativelogger {
49
49
  inline size_t getExternalMemorySize() noexcept override {
50
50
  return _swiftPart.getMemorySize();
51
51
  }
52
+ bool equals(const std::shared_ptr<HybridObject>& other) override {
53
+ if (auto otherCast = std::dynamic_pointer_cast<HybridNativeLoggerSpecSwift>(other)) {
54
+ return _swiftPart.equals(otherCast->_swiftPart);
55
+ }
56
+ return false;
57
+ }
52
58
  void dispose() noexcept override {
53
59
  _swiftPart.dispose();
54
60
  }
@@ -2,10 +2,9 @@
2
2
  /// Func_void.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// Func_void_std__exception_ptr.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// Func_void_std__vector_std__string_.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -2,10 +2,9 @@
2
2
  /// HybridNativeLoggerSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /// See ``HybridNativeLoggerSpec``
@@ -34,14 +33,14 @@ open class HybridNativeLoggerSpec_base {
34
33
  public init() { }
35
34
  public func getCxxWrapper() -> HybridNativeLoggerSpec_cxx {
36
35
  #if DEBUG
37
- guard self is HybridNativeLoggerSpec else {
36
+ guard self is any HybridNativeLoggerSpec else {
38
37
  fatalError("`self` is not a `HybridNativeLoggerSpec`! Did you accidentally inherit from `HybridNativeLoggerSpec_base` instead of `HybridNativeLoggerSpec`?")
39
38
  }
40
39
  #endif
41
40
  if let cxxWrapper = self.cxxWrapper {
42
41
  return cxxWrapper
43
42
  } else {
44
- let cxxWrapper = HybridNativeLoggerSpec_cxx(self as! HybridNativeLoggerSpec)
43
+ let cxxWrapper = HybridNativeLoggerSpec_cxx(self as! any HybridNativeLoggerSpec)
45
44
  self.cxxWrapper = cxxWrapper
46
45
  return cxxWrapper
47
46
  }
@@ -2,10 +2,9 @@
2
2
  /// HybridNativeLoggerSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -96,6 +95,14 @@ open class HybridNativeLoggerSpec_cxx {
96
95
  return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
97
96
  }
98
97
 
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridNativeLoggerSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
99
106
  /**
100
107
  * Call dispose() on the Swift class.
101
108
  * This _may_ be called manually from JS.
@@ -2,7 +2,7 @@
2
2
  /// HybridNativeLoggerSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridNativeLoggerSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridNativeLoggerSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-native-logger",
3
- "version": "3.0.81",
3
+ "version": "3.0.82",
4
4
  "description": "react-native-native-logger",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -78,12 +78,12 @@
78
78
  "eslint-plugin-prettier": "^5.5.4",
79
79
  "jest": "^29.7.0",
80
80
  "lefthook": "^2.0.3",
81
- "nitrogen": "0.31.10",
81
+ "nitrogen": "0.35.2",
82
82
  "prettier": "^2.8.8",
83
83
  "react": "19.2.0",
84
84
  "react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
85
85
  "react-native-builder-bob": "^0.40.13",
86
- "react-native-nitro-modules": "0.33.2",
86
+ "react-native-nitro-modules": "0.35.2",
87
87
  "release-it": "^19.0.4",
88
88
  "turbo": "^2.5.6",
89
89
  "typescript": "^5.9.2"
@@ -91,7 +91,7 @@
91
91
  "peerDependencies": {
92
92
  "react": "*",
93
93
  "react-native": "*",
94
- "react-native-nitro-modules": "0.33.2"
94
+ "react-native-nitro-modules": "0.35.2"
95
95
  },
96
96
  "react-native-builder-bob": {
97
97
  "source": "src",