react-native-nitro-logger 0.1.0
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.
- package/LICENSE +20 -0
- package/NitroLogger.podspec +29 -0
- package/README.md +214 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +124 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/AndroidPlatformIo.kt +100 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/HybridFileSink.kt +292 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/HybridNativeConsoleSink.kt +23 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/LogFileWriter.kt +1328 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/LogRotationPolicy.kt +186 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/LogSecureFile.kt +80 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/LogWriterRegistry.kt +420 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/NativeConsoleWriter.kt +237 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/NitroLoggerPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/nitrologger/PlatformIo.kt +165 -0
- package/docs/PARITY.md +330 -0
- package/docs/PRIVACY.md +341 -0
- package/eslint-plugin/README.md +238 -0
- package/eslint-plugin/index.js +62 -0
- package/eslint-plugin/rules/literal-subsystem.js +102 -0
- package/eslint-plugin/rules/no-computed-metadata-key.js +174 -0
- package/eslint-plugin/rules/no-derived-correlation.js +171 -0
- package/eslint-plugin/rules/no-dynamic-message.js +60 -0
- package/eslint-plugin/shared.js +1948 -0
- package/ios/Gzip.swift +203 -0
- package/ios/HybridFileSink.swift +291 -0
- package/ios/HybridNativeConsoleSink.swift +20 -0
- package/ios/LogFileWriter.swift +1280 -0
- package/ios/LogSecureFile.swift +296 -0
- package/ios/LogWriterRegistry.swift +444 -0
- package/ios/NativeConsoleWriter.swift +180 -0
- package/lib/module/Logger.js +381 -0
- package/lib/module/Logger.js.map +1 -0
- package/lib/module/ScopedLogger.js +70 -0
- package/lib/module/ScopedLogger.js.map +1 -0
- package/lib/module/config.js +23 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/destinations/Batcher.js +647 -0
- package/lib/module/destinations/Batcher.js.map +1 -0
- package/lib/module/destinations/ConsoleDestination.js +51 -0
- package/lib/module/destinations/ConsoleDestination.js.map +1 -0
- package/lib/module/destinations/FileDestination.js +360 -0
- package/lib/module/destinations/FileDestination.js.map +1 -0
- package/lib/module/destinations/NativeConsoleDestination.js +170 -0
- package/lib/module/destinations/NativeConsoleDestination.js.map +1 -0
- package/lib/module/destinations/types.js +4 -0
- package/lib/module/destinations/types.js.map +1 -0
- package/lib/module/formatters/DefaultFormatter.js +136 -0
- package/lib/module/formatters/DefaultFormatter.js.map +1 -0
- package/lib/module/formatters/JsonLinesFormatter.js +162 -0
- package/lib/module/formatters/JsonLinesFormatter.js.map +1 -0
- package/lib/module/formatters/timestamp.js +15 -0
- package/lib/module/formatters/timestamp.js.map +1 -0
- package/lib/module/formatters/types.js +4 -0
- package/lib/module/formatters/types.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/integrations/appState.js +81 -0
- package/lib/module/integrations/appState.js.map +1 -0
- package/lib/module/integrations/errorHandler.js +166 -0
- package/lib/module/integrations/errorHandler.js.map +1 -0
- package/lib/module/integrations/sanitizeError.js +238 -0
- package/lib/module/integrations/sanitizeError.js.map +1 -0
- package/lib/module/levels.js +35 -0
- package/lib/module/levels.js.map +1 -0
- package/lib/module/metadata.js +52 -0
- package/lib/module/metadata.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/privacy.js +349 -0
- package/lib/module/privacy.js.map +1 -0
- package/lib/module/specs/FileSink.nitro.js +4 -0
- package/lib/module/specs/FileSink.nitro.js.map +1 -0
- package/lib/module/specs/NativeConsoleSink.nitro.js +4 -0
- package/lib/module/specs/NativeConsoleSink.nitro.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utf8.js +42 -0
- package/lib/module/utf8.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/Logger.d.ts +122 -0
- package/lib/typescript/src/Logger.d.ts.map +1 -0
- package/lib/typescript/src/ScopedLogger.d.ts +36 -0
- package/lib/typescript/src/ScopedLogger.d.ts.map +1 -0
- package/lib/typescript/src/config.d.ts +12 -0
- package/lib/typescript/src/config.d.ts.map +1 -0
- package/lib/typescript/src/destinations/Batcher.d.ts +244 -0
- package/lib/typescript/src/destinations/Batcher.d.ts.map +1 -0
- package/lib/typescript/src/destinations/ConsoleDestination.d.ts +27 -0
- package/lib/typescript/src/destinations/ConsoleDestination.d.ts.map +1 -0
- package/lib/typescript/src/destinations/FileDestination.d.ts +200 -0
- package/lib/typescript/src/destinations/FileDestination.d.ts.map +1 -0
- package/lib/typescript/src/destinations/NativeConsoleDestination.d.ts +86 -0
- package/lib/typescript/src/destinations/NativeConsoleDestination.d.ts.map +1 -0
- package/lib/typescript/src/destinations/types.d.ts +19 -0
- package/lib/typescript/src/destinations/types.d.ts.map +1 -0
- package/lib/typescript/src/formatters/DefaultFormatter.d.ts +22 -0
- package/lib/typescript/src/formatters/DefaultFormatter.d.ts.map +1 -0
- package/lib/typescript/src/formatters/JsonLinesFormatter.d.ts +73 -0
- package/lib/typescript/src/formatters/JsonLinesFormatter.d.ts.map +1 -0
- package/lib/typescript/src/formatters/timestamp.d.ts +6 -0
- package/lib/typescript/src/formatters/timestamp.d.ts.map +1 -0
- package/lib/typescript/src/formatters/types.d.ts +27 -0
- package/lib/typescript/src/formatters/types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +34 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/integrations/appState.d.ts +33 -0
- package/lib/typescript/src/integrations/appState.d.ts.map +1 -0
- package/lib/typescript/src/integrations/errorHandler.d.ts +55 -0
- package/lib/typescript/src/integrations/errorHandler.d.ts.map +1 -0
- package/lib/typescript/src/integrations/sanitizeError.d.ts +89 -0
- package/lib/typescript/src/integrations/sanitizeError.d.ts.map +1 -0
- package/lib/typescript/src/levels.d.ts +9 -0
- package/lib/typescript/src/levels.d.ts.map +1 -0
- package/lib/typescript/src/metadata.d.ts +23 -0
- package/lib/typescript/src/metadata.d.ts.map +1 -0
- package/lib/typescript/src/privacy.d.ts +103 -0
- package/lib/typescript/src/privacy.d.ts.map +1 -0
- package/lib/typescript/src/specs/FileSink.nitro.d.ts +131 -0
- package/lib/typescript/src/specs/FileSink.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeConsoleSink.nitro.d.ts +21 -0
- package/lib/typescript/src/specs/NativeConsoleSink.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +37 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utf8.d.ts +15 -0
- package/lib/typescript/src/utf8.d.ts.map +1 -0
- package/nitro.json +33 -0
- package/nitrogen/generated/android/c++/JAppendResult.hpp +79 -0
- package/nitrogen/generated/android/c++/JClearOutcome.hpp +88 -0
- package/nitrogen/generated/android/c++/JFlushOutcome.hpp +81 -0
- package/nitrogen/generated/android/c++/JHybridFileSinkSpec.cpp +120 -0
- package/nitrogen/generated/android/c++/JHybridFileSinkSpec.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridNativeConsoleSinkSpec.cpp +71 -0
- package/nitrogen/generated/android/c++/JHybridNativeConsoleSinkSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JRejectReason.hpp +64 -0
- package/nitrogen/generated/android/c++/JRotationConfig.hpp +77 -0
- package/nitrogen/generated/android/c++/JSinkStatus.hpp +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/AppendResult.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/ClearOutcome.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/FlushOutcome.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/HybridFileSinkSpec.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/HybridNativeConsoleSinkSpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/RejectReason.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/RotationConfig.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/SinkStatus.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrologger/nitrologgerOnLoad.kt +35 -0
- package/nitrogen/generated/android/nitrologger+autolinking.cmake +83 -0
- package/nitrogen/generated/android/nitrologger+autolinking.gradle +27 -0
- package/nitrogen/generated/android/nitrologgerOnLoad.cpp +70 -0
- package/nitrogen/generated/android/nitrologgerOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/NitroLogger+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroLogger-Swift-Cxx-Bridge.cpp +50 -0
- package/nitrogen/generated/ios/NitroLogger-Swift-Cxx-Bridge.hpp +216 -0
- package/nitrogen/generated/ios/NitroLogger-Swift-Cxx-Umbrella.hpp +69 -0
- package/nitrogen/generated/ios/NitroLoggerAutolinking.mm +41 -0
- package/nitrogen/generated/ios/NitroLoggerAutolinking.swift +38 -0
- package/nitrogen/generated/ios/c++/HybridFileSinkSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridFileSinkSpecSwift.hpp +150 -0
- package/nitrogen/generated/ios/c++/HybridNativeConsoleSinkSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeConsoleSinkSpecSwift.hpp +87 -0
- package/nitrogen/generated/ios/swift/AppendResult.swift +60 -0
- package/nitrogen/generated/ios/swift/ClearOutcome.swift +50 -0
- package/nitrogen/generated/ios/swift/FlushOutcome.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridFileSinkSpec.swift +61 -0
- package/nitrogen/generated/ios/swift/HybridFileSinkSpec_cxx.swift +227 -0
- package/nitrogen/generated/ios/swift/HybridNativeConsoleSinkSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNativeConsoleSinkSpec_cxx.swift +148 -0
- package/nitrogen/generated/ios/swift/RejectReason.swift +48 -0
- package/nitrogen/generated/ios/swift/RotationConfig.swift +93 -0
- package/nitrogen/generated/ios/swift/SinkStatus.swift +44 -0
- package/nitrogen/generated/shared/c++/AppendResult.hpp +105 -0
- package/nitrogen/generated/shared/c++/ClearOutcome.hpp +96 -0
- package/nitrogen/generated/shared/c++/FlushOutcome.hpp +107 -0
- package/nitrogen/generated/shared/c++/HybridFileSinkSpec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridFileSinkSpec.hpp +84 -0
- package/nitrogen/generated/shared/c++/HybridNativeConsoleSinkSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNativeConsoleSinkSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/RejectReason.hpp +84 -0
- package/nitrogen/generated/shared/c++/RotationConfig.hpp +103 -0
- package/nitrogen/generated/shared/c++/SinkStatus.hpp +95 -0
- package/package.json +151 -0
- package/src/Logger.ts +417 -0
- package/src/ScopedLogger.ts +94 -0
- package/src/config.ts +25 -0
- package/src/destinations/Batcher.ts +805 -0
- package/src/destinations/ConsoleDestination.ts +60 -0
- package/src/destinations/FileDestination.ts +473 -0
- package/src/destinations/NativeConsoleDestination.ts +220 -0
- package/src/destinations/types.ts +19 -0
- package/src/formatters/DefaultFormatter.ts +150 -0
- package/src/formatters/JsonLinesFormatter.ts +195 -0
- package/src/formatters/timestamp.ts +12 -0
- package/src/formatters/types.ts +29 -0
- package/src/index.tsx +106 -0
- package/src/integrations/appState.ts +111 -0
- package/src/integrations/errorHandler.ts +223 -0
- package/src/integrations/sanitizeError.ts +287 -0
- package/src/levels.ts +35 -0
- package/src/metadata.ts +52 -0
- package/src/privacy.ts +389 -0
- package/src/specs/FileSink.nitro.ts +144 -0
- package/src/specs/NativeConsoleSink.nitro.ts +21 -0
- package/src/types.ts +45 -0
- package/src/utf8.ts +39 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNativeConsoleSinkSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridNativeConsoleSinkSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitrologger {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridNativeConsoleSinkSpec: public virtual HybridNativeConsoleSinkSpec, public virtual JHybridObject {
|
|
22
|
+
public:
|
|
23
|
+
struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrologger/HybridNativeConsoleSinkSpec;";
|
|
25
|
+
std::shared_ptr<JHybridNativeConsoleSinkSpec> getJHybridNativeConsoleSinkSpec();
|
|
26
|
+
};
|
|
27
|
+
struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
|
|
28
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrologger/HybridNativeConsoleSinkSpec$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
|
+
};
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
explicit JHybridNativeConsoleSinkSpec(const jni::local_ref<JHybridNativeConsoleSinkSpec::JavaPart>& javaPart):
|
|
38
|
+
HybridObject(HybridNativeConsoleSinkSpec::TAG),
|
|
39
|
+
JHybridObject(javaPart),
|
|
40
|
+
_javaPart(jni::make_global(javaPart)) {}
|
|
41
|
+
~JHybridNativeConsoleSinkSpec() override {
|
|
42
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
43
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridNativeConsoleSinkSpec::JavaPart>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
// Methods
|
|
57
|
+
void install(const std::string& subsystem, const std::string& category) override;
|
|
58
|
+
void logBatch(const std::vector<double>& levels, const std::vector<std::string>& messages) override;
|
|
59
|
+
|
|
60
|
+
private:
|
|
61
|
+
jni::global_ref<JHybridNativeConsoleSinkSpec::JavaPart> _javaPart;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::nitrologger
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRejectReason.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "RejectReason.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrologger {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "RejectReason" and the Kotlin enum "RejectReason".
|
|
19
|
+
*/
|
|
20
|
+
struct JRejectReason final: public jni::JavaClass<JRejectReason> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrologger/RejectReason;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum RejectReason.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
RejectReason toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<RejectReason>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JRejectReason> fromCpp(RejectReason value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case RejectReason::FULL:
|
|
46
|
+
static const auto fieldFULL = clazz->getStaticField<JRejectReason>("FULL");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldFULL);
|
|
48
|
+
case RejectReason::STALEGENERATION:
|
|
49
|
+
static const auto fieldSTALEGENERATION = clazz->getStaticField<JRejectReason>("STALEGENERATION");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldSTALEGENERATION);
|
|
51
|
+
case RejectReason::CLOSED:
|
|
52
|
+
static const auto fieldCLOSED = clazz->getStaticField<JRejectReason>("CLOSED");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldCLOSED);
|
|
54
|
+
case RejectReason::FAILED:
|
|
55
|
+
static const auto fieldFAILED = clazz->getStaticField<JRejectReason>("FAILED");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldFAILED);
|
|
57
|
+
default:
|
|
58
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
59
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::nitrologger
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRotationConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "RotationConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitrologger {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "RotationConfig" and the Kotlin data class "RotationConfig".
|
|
21
|
+
*/
|
|
22
|
+
struct JRotationConfig final: public jni::JavaClass<JRotationConfig> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrologger/RotationConfig;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct RotationConfig by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
RotationConfig toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldMaxFileSizeBytes = clazz->getField<double>("maxFileSizeBytes");
|
|
35
|
+
double maxFileSizeBytes = this->getFieldValue(fieldMaxFileSizeBytes);
|
|
36
|
+
static const auto fieldMaxArchivedFilesCount = clazz->getField<double>("maxArchivedFilesCount");
|
|
37
|
+
double maxArchivedFilesCount = this->getFieldValue(fieldMaxArchivedFilesCount);
|
|
38
|
+
static const auto fieldMaxFileAgeSeconds = clazz->getField<jni::JDouble>("maxFileAgeSeconds");
|
|
39
|
+
jni::local_ref<jni::JDouble> maxFileAgeSeconds = this->getFieldValue(fieldMaxFileAgeSeconds);
|
|
40
|
+
static const auto fieldCompressArchives = clazz->getField<jboolean>("compressArchives");
|
|
41
|
+
jboolean compressArchives = this->getFieldValue(fieldCompressArchives);
|
|
42
|
+
static const auto fieldMaxArchiveAgeSeconds = clazz->getField<jni::JDouble>("maxArchiveAgeSeconds");
|
|
43
|
+
jni::local_ref<jni::JDouble> maxArchiveAgeSeconds = this->getFieldValue(fieldMaxArchiveAgeSeconds);
|
|
44
|
+
static const auto fieldMaxTotalLogBytes = clazz->getField<jni::JDouble>("maxTotalLogBytes");
|
|
45
|
+
jni::local_ref<jni::JDouble> maxTotalLogBytes = this->getFieldValue(fieldMaxTotalLogBytes);
|
|
46
|
+
return RotationConfig(
|
|
47
|
+
maxFileSizeBytes,
|
|
48
|
+
maxArchivedFilesCount,
|
|
49
|
+
maxFileAgeSeconds != nullptr ? std::make_optional(maxFileAgeSeconds->value()) : std::nullopt,
|
|
50
|
+
static_cast<bool>(compressArchives),
|
|
51
|
+
maxArchiveAgeSeconds != nullptr ? std::make_optional(maxArchiveAgeSeconds->value()) : std::nullopt,
|
|
52
|
+
maxTotalLogBytes != nullptr ? std::make_optional(maxTotalLogBytes->value()) : std::nullopt
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
/**
|
|
58
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
59
|
+
*/
|
|
60
|
+
[[maybe_unused]]
|
|
61
|
+
static jni::local_ref<JRotationConfig::javaobject> fromCpp(const RotationConfig& value) {
|
|
62
|
+
using JSignature = JRotationConfig(double, double, jni::alias_ref<jni::JDouble>, jboolean, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>);
|
|
63
|
+
static const auto clazz = javaClassStatic();
|
|
64
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
65
|
+
return create(
|
|
66
|
+
clazz,
|
|
67
|
+
value.maxFileSizeBytes,
|
|
68
|
+
value.maxArchivedFilesCount,
|
|
69
|
+
value.maxFileAgeSeconds.has_value() ? jni::JDouble::valueOf(value.maxFileAgeSeconds.value()) : nullptr,
|
|
70
|
+
value.compressArchives,
|
|
71
|
+
value.maxArchiveAgeSeconds.has_value() ? jni::JDouble::valueOf(value.maxArchiveAgeSeconds.value()) : nullptr,
|
|
72
|
+
value.maxTotalLogBytes.has_value() ? jni::JDouble::valueOf(value.maxTotalLogBytes.value()) : nullptr
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::nitrologger
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSinkStatus.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SinkStatus.hpp"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitrologger {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "SinkStatus" and the Kotlin data class "SinkStatus".
|
|
21
|
+
*/
|
|
22
|
+
struct JSinkStatus final: public jni::JavaClass<JSinkStatus> {
|
|
23
|
+
public:
|
|
24
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrologger/SinkStatus;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct SinkStatus by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
SinkStatus toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldQueuedBytes = clazz->getField<double>("queuedBytes");
|
|
35
|
+
double queuedBytes = this->getFieldValue(fieldQueuedBytes);
|
|
36
|
+
static const auto fieldLostBytes = clazz->getField<double>("lostBytes");
|
|
37
|
+
double lostBytes = this->getFieldValue(fieldLostBytes);
|
|
38
|
+
static const auto fieldLostEntries = clazz->getField<double>("lostEntries");
|
|
39
|
+
double lostEntries = this->getFieldValue(fieldLostEntries);
|
|
40
|
+
static const auto fieldDegraded = clazz->getField<double>("degraded");
|
|
41
|
+
double degraded = this->getFieldValue(fieldDegraded);
|
|
42
|
+
return SinkStatus(
|
|
43
|
+
queuedBytes,
|
|
44
|
+
lostBytes,
|
|
45
|
+
lostEntries,
|
|
46
|
+
degraded
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/**
|
|
52
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
|
+
*/
|
|
54
|
+
[[maybe_unused]]
|
|
55
|
+
static jni::local_ref<JSinkStatus::javaobject> fromCpp(const SinkStatus& value) {
|
|
56
|
+
using JSignature = JSinkStatus(double, double, double, double);
|
|
57
|
+
static const auto clazz = javaClassStatic();
|
|
58
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
|
+
return create(
|
|
60
|
+
clazz,
|
|
61
|
+
value.queuedBytes,
|
|
62
|
+
value.lostBytes,
|
|
63
|
+
value.lostEntries,
|
|
64
|
+
value.degraded
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace margelo::nitro::nitrologger
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AppendResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrologger
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "AppendResult".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class AppendResult(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val accepted: Boolean,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val rejectReason: RejectReason?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val queuedBytes: Double,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val lostBytes: Double,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val lostEntries: Double,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val degraded: Double
|
|
39
|
+
) {
|
|
40
|
+
/* primary constructor */
|
|
41
|
+
|
|
42
|
+
override fun equals(other: Any?): Boolean {
|
|
43
|
+
if (this === other) return true
|
|
44
|
+
if (other !is AppendResult) return false
|
|
45
|
+
return Objects.deepEquals(this.accepted, other.accepted)
|
|
46
|
+
&& Objects.deepEquals(this.rejectReason, other.rejectReason)
|
|
47
|
+
&& Objects.deepEquals(this.queuedBytes, other.queuedBytes)
|
|
48
|
+
&& Objects.deepEquals(this.lostBytes, other.lostBytes)
|
|
49
|
+
&& Objects.deepEquals(this.lostEntries, other.lostEntries)
|
|
50
|
+
&& Objects.deepEquals(this.degraded, other.degraded)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun hashCode(): Int {
|
|
54
|
+
return arrayOf<Any?>(
|
|
55
|
+
accepted,
|
|
56
|
+
rejectReason,
|
|
57
|
+
queuedBytes,
|
|
58
|
+
lostBytes,
|
|
59
|
+
lostEntries,
|
|
60
|
+
degraded
|
|
61
|
+
).contentDeepHashCode()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
companion object {
|
|
65
|
+
/**
|
|
66
|
+
* Constructor called from C++
|
|
67
|
+
*/
|
|
68
|
+
@DoNotStrip
|
|
69
|
+
@Keep
|
|
70
|
+
@Suppress("unused")
|
|
71
|
+
@JvmStatic
|
|
72
|
+
private fun fromCpp(accepted: Boolean, rejectReason: RejectReason?, queuedBytes: Double, lostBytes: Double, lostEntries: Double, degraded: Double): AppendResult {
|
|
73
|
+
return AppendResult(accepted, rejectReason, queuedBytes, lostBytes, lostEntries, degraded)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ClearOutcome.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrologger
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "ClearOutcome".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class ClearOutcome(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val deletedCount: Double,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val failedPaths: Array<String>,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val durable: Boolean,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val rebound: Boolean
|
|
33
|
+
) {
|
|
34
|
+
/* primary constructor */
|
|
35
|
+
|
|
36
|
+
override fun equals(other: Any?): Boolean {
|
|
37
|
+
if (this === other) return true
|
|
38
|
+
if (other !is ClearOutcome) return false
|
|
39
|
+
return Objects.deepEquals(this.deletedCount, other.deletedCount)
|
|
40
|
+
&& Objects.deepEquals(this.failedPaths, other.failedPaths)
|
|
41
|
+
&& Objects.deepEquals(this.durable, other.durable)
|
|
42
|
+
&& Objects.deepEquals(this.rebound, other.rebound)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun hashCode(): Int {
|
|
46
|
+
return arrayOf<Any?>(
|
|
47
|
+
deletedCount,
|
|
48
|
+
failedPaths,
|
|
49
|
+
durable,
|
|
50
|
+
rebound
|
|
51
|
+
).contentDeepHashCode()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
companion object {
|
|
55
|
+
/**
|
|
56
|
+
* Constructor called from C++
|
|
57
|
+
*/
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
@Suppress("unused")
|
|
61
|
+
@JvmStatic
|
|
62
|
+
private fun fromCpp(deletedCount: Double, failedPaths: Array<String>, durable: Boolean, rebound: Boolean): ClearOutcome {
|
|
63
|
+
return ClearOutcome(deletedCount, failedPaths, durable, rebound)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// FlushOutcome.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrologger
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "FlushOutcome".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class FlushOutcome(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val durable: Boolean,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val timedOut: Boolean,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val pendingBytes: Double,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val queuedBytes: Double,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val lostBytes: Double,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val lostEntries: Double,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
val degraded: Double
|
|
42
|
+
) {
|
|
43
|
+
/* primary constructor */
|
|
44
|
+
|
|
45
|
+
override fun equals(other: Any?): Boolean {
|
|
46
|
+
if (this === other) return true
|
|
47
|
+
if (other !is FlushOutcome) return false
|
|
48
|
+
return Objects.deepEquals(this.durable, other.durable)
|
|
49
|
+
&& Objects.deepEquals(this.timedOut, other.timedOut)
|
|
50
|
+
&& Objects.deepEquals(this.pendingBytes, other.pendingBytes)
|
|
51
|
+
&& Objects.deepEquals(this.queuedBytes, other.queuedBytes)
|
|
52
|
+
&& Objects.deepEquals(this.lostBytes, other.lostBytes)
|
|
53
|
+
&& Objects.deepEquals(this.lostEntries, other.lostEntries)
|
|
54
|
+
&& Objects.deepEquals(this.degraded, other.degraded)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
override fun hashCode(): Int {
|
|
58
|
+
return arrayOf<Any?>(
|
|
59
|
+
durable,
|
|
60
|
+
timedOut,
|
|
61
|
+
pendingBytes,
|
|
62
|
+
queuedBytes,
|
|
63
|
+
lostBytes,
|
|
64
|
+
lostEntries,
|
|
65
|
+
degraded
|
|
66
|
+
).contentDeepHashCode()
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
companion object {
|
|
70
|
+
/**
|
|
71
|
+
* Constructor called from C++
|
|
72
|
+
*/
|
|
73
|
+
@DoNotStrip
|
|
74
|
+
@Keep
|
|
75
|
+
@Suppress("unused")
|
|
76
|
+
@JvmStatic
|
|
77
|
+
private fun fromCpp(durable: Boolean, timedOut: Boolean, pendingBytes: Double, queuedBytes: Double, lostBytes: Double, lostEntries: Double, degraded: Double): FlushOutcome {
|
|
78
|
+
return FlushOutcome(durable, timedOut, pendingBytes, queuedBytes, lostBytes, lostEntries, degraded)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridFileSinkSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrologger
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.HybridObject
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the FileSink HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of FileSink.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridFileSinkSpec: HybridObject() {
|
|
27
|
+
// Properties
|
|
28
|
+
@get:DoNotStrip
|
|
29
|
+
@get:Keep
|
|
30
|
+
abstract val defaultLogDirectory: String
|
|
31
|
+
|
|
32
|
+
// Methods
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
abstract fun open(path: String, rotation: RotationConfig?, lineFramed: Boolean?): Unit
|
|
36
|
+
|
|
37
|
+
@DoNotStrip
|
|
38
|
+
@Keep
|
|
39
|
+
abstract fun appendBatch(batch: String, entryCount: Double): AppendResult
|
|
40
|
+
|
|
41
|
+
@DoNotStrip
|
|
42
|
+
@Keep
|
|
43
|
+
abstract fun getStatus(): SinkStatus
|
|
44
|
+
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
abstract fun flush(deadlineMs: Double): FlushOutcome
|
|
48
|
+
|
|
49
|
+
@DoNotStrip
|
|
50
|
+
@Keep
|
|
51
|
+
abstract fun close(deadlineMs: Double): FlushOutcome
|
|
52
|
+
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
abstract fun getLogFilePaths(): Array<String>
|
|
56
|
+
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
abstract fun clearLogs(deadlineMs: Double): ClearOutcome
|
|
60
|
+
|
|
61
|
+
// Default implementation of `HybridObject.toString()`
|
|
62
|
+
override fun toString(): String {
|
|
63
|
+
return "[HybridObject FileSink]"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// C++ backing class
|
|
67
|
+
@DoNotStrip
|
|
68
|
+
@Keep
|
|
69
|
+
protected open class CxxPart(javaPart: HybridFileSinkSpec): HybridObject.CxxPart(javaPart) {
|
|
70
|
+
// C++ JHybridFileSinkSpec::CxxPart::initHybrid(...)
|
|
71
|
+
external override fun initHybrid(): HybridData
|
|
72
|
+
}
|
|
73
|
+
override fun createCxxPart(): CxxPart {
|
|
74
|
+
return CxxPart(this)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
companion object {
|
|
78
|
+
protected const val TAG = "HybridFileSinkSpec"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNativeConsoleSinkSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrologger
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.HybridObject
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the NativeConsoleSink HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of NativeConsoleSink.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridNativeConsoleSinkSpec: HybridObject() {
|
|
27
|
+
// Properties
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Methods
|
|
31
|
+
@DoNotStrip
|
|
32
|
+
@Keep
|
|
33
|
+
abstract fun install(subsystem: String, category: String): Unit
|
|
34
|
+
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
37
|
+
abstract fun logBatch(levels: DoubleArray, messages: Array<String>): Unit
|
|
38
|
+
|
|
39
|
+
// Default implementation of `HybridObject.toString()`
|
|
40
|
+
override fun toString(): String {
|
|
41
|
+
return "[HybridObject NativeConsoleSink]"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// C++ backing class
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
protected open class CxxPart(javaPart: HybridNativeConsoleSinkSpec): HybridObject.CxxPart(javaPart) {
|
|
48
|
+
// C++ JHybridNativeConsoleSinkSpec::CxxPart::initHybrid(...)
|
|
49
|
+
external override fun initHybrid(): HybridData
|
|
50
|
+
}
|
|
51
|
+
override fun createCxxPart(): CxxPart {
|
|
52
|
+
return CxxPart(this)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
companion object {
|
|
56
|
+
protected const val TAG = "HybridNativeConsoleSinkSpec"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RejectReason.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrologger
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "RejectReason".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class RejectReason(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
FULL(0),
|
|
20
|
+
STALEGENERATION(1),
|
|
21
|
+
CLOSED(2),
|
|
22
|
+
FAILED(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|