Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d51036e

Browse files
author
sergeysozinov
committed
Revert "MBX-3547: add logging"
This reverts commit 145be53, reversing changes made to c40985b.
1 parent 145be53 commit d51036e

File tree

7 files changed

+0
-102
lines changed

7 files changed

+0
-102
lines changed

mindbox/lib/mindbox.dart

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,4 @@ class Mindbox {
153153
MindboxPlatform.instance
154154
.updateNotificationPermissionStatus(granted: granted);
155155
}
156-
157-
/// Writes a log message to the native Mindbox logging system.
158-
///
159-
/// Usage example:
160-
///
161-
/// ```dart
162-
/// Mindbox.instance.writeNativeLog(
163-
/// message: 'This is a debug message',
164-
/// logLevel: LogLevel.debug,
165-
/// );
166-
/// ```
167-
///
168-
/// [message]: The message to be logged.
169-
/// [logLevel]: The severity level of the log message [LogLevel].
170-
///
171-
void writeNativeLog({required String message, required LogLevel logLevel}) {
172-
MindboxPlatform.instance
173-
.writeNativeLog(message: message, logLevel: logLevel);
174-
}
175156
}

mindbox_android/android/src/main/kotlin/cloud/mindbox/mindbox_android/MindboxAndroidPlugin.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,6 @@ class MindboxAndroidPlugin : FlutterPlugin, MethodCallHandler, ActivityAware, Ne
155155
"updateNotificationPermissionStatus" -> {
156156
Mindbox.updateNotificationPermissionStatus(context = context)
157157
}
158-
159-
"writeNativeLog" -> {
160-
if (call.arguments is List<*>) {
161-
val args = call.arguments as List<*>
162-
if (args.size < 2) {
163-
result.error("-1", "error", "Wrong argument count")
164-
}
165-
try {
166-
val message: String? = args[0] as String
167-
val logIndex: Int = args[1] as Int
168-
val logLevel: Level = Level.values()[logIndex]
169-
Mindbox.writeLog(message!!, logLevel)
170-
result.success(0)
171-
}
172-
catch (e: Exception)
173-
{
174-
result.error("-1", "error", "Exception occurred: ${e.message}")
175-
}
176-
}
177-
}
178158
else -> {
179159
result.notImplemented()
180160
}

mindbox_android/lib/src/mindbox_android_platform.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,4 @@ class MindboxAndroidPlatform extends MindboxPlatform {
101101
void updateNotificationPermissionStatus({required bool granted}) {
102102
_methodHandler.updateNotificationPermissionStatus(granted: granted);
103103
}
104-
105-
@override
106-
void writeNativeLog({required String message, required LogLevel logLevel}) {
107-
_methodHandler.writeNativeLog(message: message, logLevel: logLevel);
108-
}
109104
}

mindbox_ios/ios/Classes/SwiftMindboxIosPlugin.swift

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Flutter
22
import UIKit
33
import Mindbox
4-
import MindboxLogger
54

65

76

@@ -165,37 +164,6 @@ public class SwiftMindboxIosPlugin: NSObject, FlutterPlugin {
165164
return
166165
}
167166
Mindbox.shared.notificationsRequestAuthorization(granted: granted)
168-
169-
case "writeNativeLog":
170-
guard let args = call.arguments as? [Any], args.count >= 2 else {
171-
result(FlutterError(code: "-1", message: "error", details: "Wrong argument count or type"))
172-
return
173-
}
174-
175-
guard let message = args[0] as? String,
176-
let levelIndex = args[1] as? Int else {
177-
result(FlutterError(code: "-1", message: "error", details: "Wrong argument type"))
178-
return
179-
}
180-
let logLevel: LogLevel
181-
182-
switch levelIndex {
183-
case 0:
184-
logLevel = .debug
185-
case 1:
186-
logLevel = .info
187-
case 2:
188-
logLevel = .default
189-
case 3:
190-
logLevel = .error
191-
case 4:
192-
logLevel = .fault
193-
default:
194-
logLevel = .none
195-
}
196-
Mindbox.logger.log(level: logLevel, message: message)
197-
result(0)
198-
199167
default:
200168
result(FlutterMethodNotImplemented)
201169
}

mindbox_ios/lib/src/mindbox_ios_platform.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,4 @@ class MindboxIosPlatform extends MindboxPlatform {
101101
void updateNotificationPermissionStatus({required bool granted}) {
102102
_methodHandler.updateNotificationPermissionStatus(granted: granted);
103103
}
104-
105-
/// Writes a log message to the native Mindbox logging system.
106-
@override
107-
void writeNativeLog({required String message, required LogLevel logLevel}) {
108-
_methodHandler.writeNativeLog(message: message, logLevel: logLevel);
109-
}
110104
}

mindbox_platform_interface/lib/src/mindbox_platform.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ abstract class MindboxPlatform {
123123
void updateNotificationPermissionStatus({required bool granted}) =>
124124
throw UnimplementedError(
125125
'updateNotificationPermissionStatus() has not been implemented');
126-
127-
/// Writes a log message to the native Mindbox logging system.
128-
void writeNativeLog({required String message, required LogLevel logLevel}) =>
129-
throw UnimplementedError(
130-
'writeNativeLog() has not been implemented');
131126
}
132127

133128

mindbox_platform_interface/lib/src/types/mindbox_method_handler.dart

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class MindboxMethodHandler {
3636
bool _initialized = false;
3737
final List<_PendingCallbackMethod> _pendingCallbackMethods = [];
3838
final List<_PendingOperations> _pendingOperations = [];
39-
final String _logPrefix = '[Flutter] ';
4039
PushClickHandler? _pushClickHandler;
4140
InAppClickHandler? _inAppClickHandler;
4241
InAppDismissedHandler? _inAppDismissedHandler;
@@ -85,7 +84,6 @@ class MindboxMethodHandler {
8584
_pendingCallbackMethods.clear();
8685
_pendingOperations.clear();
8786
_initialized = true;
88-
_logInfo('Init in Flutter');
8987
} on PlatformException catch (e) {
9088
throw MindboxInitializeError(
9189
message: e.message ?? '', data: e.details ?? '');
@@ -286,14 +284,6 @@ class MindboxMethodHandler {
286284
data: exception.message!);
287285
}
288286
}
289-
/// Writes a log message to the native Mindbox logging system.
290-
/// [message]: The message to be logged
291-
/// [logLevel]: The severity level of the log message [LogLevel]
292-
void writeNativeLog(
293-
{required String message, required LogLevel logLevel}) async {
294-
await channel
295-
.invokeMethod('writeNativeLog', [_logPrefix + message, logLevel.index]);
296-
}
297287

298288
void _setMethodCallHandler() {
299289
channel.setMethodCallHandler((call) {
@@ -319,9 +309,4 @@ class MindboxMethodHandler {
319309
});
320310
_methodHandlerSet = true;
321311
}
322-
323-
void _logInfo(String message) {
324-
writeNativeLog(message: message, logLevel: LogLevel.info);
325-
}
326-
327312
}

0 commit comments

Comments
 (0)