cordova-plugin-unvired-logger 0.0.19 → 0.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-unvired-logger",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "A logger plugin for Electron, Android, Browser, and iOS that appends logs to log.txt files organized by user ID.",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-unvired-logger",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <plugin id="cordova-plugin-unvired-logger" version="0.0.19"
2
+ <plugin id="cordova-plugin-unvired-logger" version="0.0.21"
3
3
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
4
  xmlns:android="http://schemas.android.com/apk/res/android">
5
5
 
@@ -19,7 +19,7 @@ public class Logger extends CordovaPlugin {
19
19
 
20
20
  private static final String LOG_FILE_NAME = "log.txt";
21
21
  private static final String BACKUP_LOG_FILE_NAME = "log_backup.txt";
22
- private static final long MAX_LOG_SIZE = 10 * 1024 * 1024; // 10MB
22
+ private static final long MAX_LOG_SIZE = 50 * 1024 * 1024; // 50MB
23
23
 
24
24
  // LogLevel constants as int
25
25
  private static final int LOG_LEVEL_DEBUG = 7;
@@ -1,6 +1,6 @@
1
1
  const LOG_FILE_NAME = 'log.txt';
2
2
  const BACKUP_LOG_FILE_NAME = 'log_backup.txt';
3
- const MAX_LOG_SIZE = 10 * 1024 * 1024; // 10MB
3
+ const MAX_LOG_SIZE = 50 * 1024 * 1024; // 50MB
4
4
 
5
5
  const LogLevel = {
6
6
  Debug: 7,
@@ -42,7 +42,7 @@ const LogLevel = {
42
42
  };
43
43
 
44
44
  let defaultLogLevel = LogLevel.Info; // Now an int
45
- const MAX_LOG_SIZE = 10 * 1024 * 1024; // 10MB
45
+ const MAX_LOG_SIZE = 50 * 1024 * 1024; // 50MB
46
46
 
47
47
  function logDebug(args) {
48
48
  return loggerWithLevel(args);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-unvired-logger",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Electron platform package for cordova-plugin-unvired-logger",
5
5
  "main": "Logger.js",
6
6
  "scripts": {
@@ -5,7 +5,7 @@ import UIKit
5
5
 
6
6
  private let LOG_FILE_NAME = "log.txt"
7
7
  private let BACKUP_LOG_FILE_NAME = "log_backup.txt"
8
- private let MAX_LOG_SIZE: Int64 = 10 * 1024 * 1024 // 10MB
8
+ private let MAX_LOG_SIZE: Int64 = 50 * 1024 * 1024 // 50MB
9
9
  private let logWriteQueue = DispatchQueue(label: "cordova.plugin.unvired.logger.write")
10
10
 
11
11
  private var defaultLogLevel: Int = 8
@@ -61,7 +61,9 @@ import UIKit
61
61
  let logEntry = self.formatLogEntry(level: level, sourceClass: sourceClass, sourceMethod: sourceMethod, message: message)
62
62
 
63
63
  // Print to console before writing to file
64
+ #if DEBUG
64
65
  NSLog("%@", logEntry.trimmingCharacters(in: .whitespacesAndNewlines))
66
+ #endif
65
67
  self.commandDelegate.run(inBackground: {
66
68
  // Serialize rotation + write to guarantee ordering
67
69
  self.logWriteQueue.async {