feat(log): implement mobile logging

This commit is contained in:
Lucas Nogueira
2023-01-16 17:47:43 -03:00
parent 58dd417f1b
commit 42037a7a99
4 changed files with 420 additions and 131 deletions
Generated
+225 -67
View File
@@ -91,7 +91,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ec2333c185d826313162cee39d3fcc6a84ba08114a839bebf53b961e7e75773"
dependencies = [
"android_log-sys",
"env_logger 0.7.1",
"env_logger",
"lazy_static",
"log",
]
@@ -956,6 +956,19 @@ dependencies = [
"syn",
]
[[package]]
name = "dashmap"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
dependencies = [
"cfg-if 1.0.0",
"hashbrown",
"lock_api",
"once_cell",
"parking_lot_core 0.9.6",
]
[[package]]
name = "der"
version = "0.5.1"
@@ -1161,19 +1174,6 @@ dependencies = [
"regex",
]
[[package]]
name = "env_logger"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
dependencies = [
"atty",
"humantime",
"log",
"regex",
"termcolor",
]
[[package]]
name = "event-listener"
version = "2.5.3"
@@ -1882,12 +1882,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "humantime"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
version = "0.14.23"
@@ -1977,10 +1971,11 @@ dependencies = [
[[package]]
name = "ignore"
version = "0.4.19"
version = "0.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a05705bc64e0b66a806c3740bd6578ea66051b157ec42dc219c785cbf185aef3"
checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d"
dependencies = [
"crossbeam-utils",
"globset",
"lazy_static",
"log",
@@ -2848,6 +2843,17 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "oslog"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d2043d1f61d77cb2f4b1f7b7b2295f40507f5f8e9d1c8bf10a1ca5f97a3969"
dependencies = [
"cc",
"dashmap",
"log",
]
[[package]]
name = "overload"
version = "0.1.1"
@@ -4229,9 +4235,9 @@ dependencies = [
[[package]]
name = "tao"
version = "0.15.8"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac8e6399427c8494f9849b58694754d7cc741293348a6836b6c8d2c5aa82d8e6"
checksum = "704522803dda895767f69198af8351b0a3f4fe2e293c3ca54cce0ecba05a97f2"
dependencies = [
"bitflags",
"cairo-rs",
@@ -4263,11 +4269,11 @@ dependencies = [
"objc",
"once_cell",
"parking_lot 0.12.1",
"paste",
"png",
"raw-window-handle",
"scopeguard",
"serde",
"tao-macros",
"unicode-segmentation",
"uuid 1.2.2",
"windows 0.39.0",
@@ -4275,6 +4281,17 @@ dependencies = [
"x11-dl",
]
[[package]]
name = "tao-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b6fcd8245d45a39ffc8715183d92ae242750eb57b285eb3bcd63dfd512afd09"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tar"
version = "0.4.38"
@@ -4289,17 +4306,13 @@ dependencies = [
[[package]]
name = "tauri"
version = "2.0.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8dca2d7a5853ab98d1453bf74078308f175634934e2fd1f427433c56c179da5"
dependencies = [
"android_logger",
"anyhow",
"attohttpc",
"cocoa",
"dirs-next",
"embed_plist",
"encoding_rs",
"env_logger 0.9.3",
"flate2",
"futures-util",
"glib",
@@ -4308,6 +4321,7 @@ dependencies = [
"heck 0.4.0",
"http",
"ignore",
"libc",
"log",
"objc",
"once_cell",
@@ -4322,10 +4336,60 @@ dependencies = [
"serialize-to-javascript",
"state",
"tar",
"tauri-macros",
"tauri-runtime",
"tauri-runtime-wry",
"tauri-utils",
"tauri-macros 2.0.0-alpha.0",
"tauri-runtime 0.13.0-alpha.0",
"tauri-runtime-wry 0.13.0-alpha.0",
"tauri-utils 2.0.0-alpha.0",
"tempfile",
"thiserror",
"tokio",
"url",
"uuid 1.2.2",
"webkit2gtk",
"webview2-com",
"windows 0.39.0",
]
[[package]]
name = "tauri"
version = "2.0.0-alpha.2"
source = "git+https://github.com/tauri-apps/tauri?branch=next#c36d451bcd9576dd4e0c673078c421dcb83932be"
dependencies = [
"android_logger",
"anyhow",
"attohttpc",
"cocoa",
"dirs-next",
"embed_plist",
"encoding_rs",
"flate2",
"futures-util",
"glib",
"glob",
"gtk",
"heck 0.4.0",
"http",
"ignore",
"libc",
"log",
"objc",
"once_cell",
"oslog",
"paste",
"percent-encoding",
"rand 0.8.5",
"raw-window-handle",
"semver 1.0.16",
"serde",
"serde_json",
"serde_repr",
"serialize-to-javascript",
"state",
"tar",
"tauri-macros 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"tauri-runtime 0.13.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"tauri-runtime-wry 0.13.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"tauri-utils 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"tempfile",
"thiserror",
"tokio",
@@ -4339,8 +4403,6 @@ dependencies = [
[[package]]
name = "tauri-codegen"
version = "2.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e78b01de486c5aefb99d2623d856b3d3afb88499bc9b8514e246762505006c1"
dependencies = [
"base64 0.13.1",
"brotli",
@@ -4354,7 +4416,32 @@ dependencies = [
"serde",
"serde_json",
"sha2 0.10.6",
"tauri-utils",
"tauri-utils 2.0.0-alpha.0",
"thiserror",
"time 0.3.17",
"url",
"uuid 1.2.2",
"walkdir",
]
[[package]]
name = "tauri-codegen"
version = "2.0.0-alpha.0"
source = "git+https://github.com/tauri-apps/tauri?branch=next#c36d451bcd9576dd4e0c673078c421dcb83932be"
dependencies = [
"base64 0.13.1",
"brotli",
"ico",
"json-patch",
"plist",
"png",
"proc-macro2",
"quote",
"semver 1.0.16",
"serde",
"serde_json",
"sha2 0.10.6",
"tauri-utils 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"time 0.3.17",
"url",
@@ -4365,15 +4452,26 @@ dependencies = [
[[package]]
name = "tauri-macros"
version = "2.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df039672c40713ded0f7991efd1d7d6219e008c73137483d6dd2d9988f39472e"
dependencies = [
"heck 0.4.0",
"proc-macro2",
"quote",
"syn",
"tauri-codegen",
"tauri-utils",
"tauri-codegen 2.0.0-alpha.0",
"tauri-utils 2.0.0-alpha.0",
]
[[package]]
name = "tauri-macros"
version = "2.0.0-alpha.0"
source = "git+https://github.com/tauri-apps/tauri?branch=next#c36d451bcd9576dd4e0c673078c421dcb83932be"
dependencies = [
"heck 0.4.0",
"proc-macro2",
"quote",
"syn",
"tauri-codegen 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"tauri-utils 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
]
[[package]]
@@ -4390,7 +4488,7 @@ dependencies = [
"serde",
"serde_json",
"sha2 0.10.6",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"u2f",
]
@@ -4403,7 +4501,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
@@ -4414,7 +4512,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
@@ -4426,7 +4524,7 @@ dependencies = [
"notify",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
@@ -4438,7 +4536,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"tiny_http",
]
@@ -4447,13 +4545,15 @@ dependencies = [
name = "tauri-plugin-log"
version = "0.1.0"
dependencies = [
"android_logger",
"byte-unit",
"fern",
"log",
"oslog",
"serde",
"serde_json",
"serde_repr",
"tauri",
"tauri 2.0.0-alpha.2",
"time 0.3.17",
]
@@ -4465,7 +4565,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
@@ -4477,7 +4577,7 @@ dependencies = [
"serde",
"serde_json",
"serde_repr",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
@@ -4488,7 +4588,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"windows-sys",
"zbus",
@@ -4503,7 +4603,7 @@ dependencies = [
"serde",
"serde_json",
"sqlx",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"tokio",
]
@@ -4515,7 +4615,7 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
@@ -4531,7 +4631,7 @@ dependencies = [
"rusty-fork",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"zeroize",
]
@@ -4546,7 +4646,7 @@ dependencies = [
"reqwest",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"tokio",
"tokio-util",
@@ -4561,7 +4661,7 @@ dependencies = [
"rand 0.8.5",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"tokio",
"tokio-tungstenite",
@@ -4575,15 +4675,13 @@ dependencies = [
"log",
"serde",
"serde_json",
"tauri",
"tauri 2.0.0-alpha.2 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
]
[[package]]
name = "tauri-runtime"
version = "0.13.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "010bdd6bb6585b647afe262d3e43ec612969f328d32c9ce20f9cfaefccb5e7a9"
dependencies = [
"gtk",
"http",
@@ -4592,7 +4690,26 @@ dependencies = [
"raw-window-handle",
"serde",
"serde_json",
"tauri-utils",
"tauri-utils 2.0.0-alpha.0",
"thiserror",
"uuid 1.2.2",
"webview2-com",
"windows 0.39.0",
]
[[package]]
name = "tauri-runtime"
version = "0.13.0-alpha.0"
source = "git+https://github.com/tauri-apps/tauri?branch=next#c36d451bcd9576dd4e0c673078c421dcb83932be"
dependencies = [
"gtk",
"http",
"http-range",
"rand 0.8.5",
"raw-window-handle",
"serde",
"serde_json",
"tauri-utils 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"thiserror",
"uuid 1.2.2",
"webview2-com",
@@ -4602,16 +4719,33 @@ dependencies = [
[[package]]
name = "tauri-runtime-wry"
version = "0.13.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dadf5f22694dbb5a1fd9496fe28f48ba4288ed4cb8c2584911a81cd57e24e90"
dependencies = [
"cocoa",
"gtk",
"percent-encoding",
"rand 0.8.5",
"raw-window-handle",
"tauri-runtime",
"tauri-utils",
"tauri-runtime 0.13.0-alpha.0",
"tauri-utils 2.0.0-alpha.0",
"uuid 1.2.2",
"webkit2gtk",
"webview2-com",
"windows 0.39.0",
"wry",
]
[[package]]
name = "tauri-runtime-wry"
version = "0.13.0-alpha.0"
source = "git+https://github.com/tauri-apps/tauri?branch=next#c36d451bcd9576dd4e0c673078c421dcb83932be"
dependencies = [
"cocoa",
"gtk",
"percent-encoding",
"rand 0.8.5",
"raw-window-handle",
"tauri-runtime 0.13.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"tauri-utils 2.0.0-alpha.0 (git+https://github.com/tauri-apps/tauri?branch=next)",
"uuid 1.2.2",
"webkit2gtk",
"webview2-com",
@@ -4622,8 +4756,33 @@ dependencies = [
[[package]]
name = "tauri-utils"
version = "2.0.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c7ee9f908d975a116f2fe3db47d65b18e568aa7913aa333b7a5cd990f179e5e"
dependencies = [
"brotli",
"ctor",
"glob",
"heck 0.4.0",
"html5ever",
"infer",
"json-patch",
"kuchiki",
"memchr",
"phf 0.10.1",
"proc-macro2",
"quote",
"semver 1.0.16",
"serde",
"serde_json",
"serde_with",
"thiserror",
"url",
"walkdir",
"windows 0.39.0",
]
[[package]]
name = "tauri-utils"
version = "2.0.0-alpha.0"
source = "git+https://github.com/tauri-apps/tauri?branch=next#c36d451bcd9576dd4e0c673078c421dcb83932be"
dependencies = [
"brotli",
"ctor",
@@ -5632,9 +5791,8 @@ dependencies = [
[[package]]
name = "wry"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c1ad8e2424f554cc5bdebe8aa374ef5b433feff817aebabca0389961fc7ef98"
version = "0.24.1"
source = "git+https://github.com/tauri-apps/wry?branch=dev#87216c7f01d5f65641422343dd0aa7f08ea61d0d"
dependencies = [
"base64 0.13.1",
"block",