chore: fix log (#4740)

* chore: fix log

* chore: fix log

* chore: bump client api
This commit is contained in:
Nathan.fooo 2024-02-26 15:27:12 +08:00 committed by GitHub
parent daedf95c95
commit 8d50ad2936
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 271 additions and 196 deletions

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void); void link_me_please(void);
void backend_log(int64_t level, const char *data); void rust_log(int64_t level, const char *data);
void set_env(const char *data); void set_env(const char *data);

View File

@ -5,6 +5,7 @@ import 'package:appflowy/env/backend_env.dart';
import 'package:appflowy/env/cloud_env.dart'; import 'package:appflowy/env/cloud_env.dart';
import 'package:appflowy/user/application/auth/device_id.dart'; import 'package:appflowy/user/application/auth/device_id.dart';
import 'package:appflowy_backend/appflowy_backend.dart'; import 'package:appflowy_backend/appflowy_backend.dart';
import 'package:appflowy_backend/log.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
@ -38,6 +39,7 @@ class InitRustSDKTask extends LaunchTask {
rustEnvs: context.config.rustEnvs, rustEnvs: context.config.rustEnvs,
); );
await context.getIt<FlowySDK>().init(jsonEncode(env.toJson())); await context.getIt<FlowySDK>().init(jsonEncode(env.toJson()));
Log.info('Rust SDK initialized');
} }
@override @override

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void); void link_me_please(void);
void backend_log(int64_t level, const char *data); void rust_log(int64_t level, const char *data);
void set_env(const char *data); void set_env(const char *data);

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void); void link_me_please(void);
void backend_log(int64_t level, const char *data); void rust_log(int64_t level, const char *data);
void set_env(const char *data); void set_env(const char *data);

View File

@ -137,20 +137,20 @@ typedef _store_dart_post_cobject_Dart = void Function(
Pointer<NativeFunction<Int8 Function(Int64, Pointer<Dart_CObject>)>> ptr, Pointer<NativeFunction<Int8 Function(Int64, Pointer<Dart_CObject>)>> ptr,
); );
void log( void rust_log(
int level, int level,
Pointer<ffi.Utf8> data, Pointer<ffi.Utf8> data,
) { ) {
_invoke_log(level, data); _invoke_rust_log(level, data);
} }
final _invoke_log_Dart _invoke_log = _dart_ffi_lib final _invoke_rust_log_Dart _invoke_rust_log = _dart_ffi_lib
.lookupFunction<_invoke_log_C, _invoke_log_Dart>('backend_log'); .lookupFunction<_invoke_rust_log_C, _invoke_rust_log_Dart>('rust_log');
typedef _invoke_log_C = Void Function( typedef _invoke_rust_log_C = Void Function(
Int64 level, Int64 level,
Pointer<ffi.Utf8> data, Pointer<ffi.Utf8> data,
); );
typedef _invoke_log_Dart = void Function( typedef _invoke_rust_log_Dart = void Function(
int level, int level,
Pointer<ffi.Utf8>, Pointer<ffi.Utf8>,
); );

View File

@ -9,6 +9,7 @@ import 'ffi.dart';
class Log { class Log {
static final shared = Log(); static final shared = Log();
// ignore: unused_field
late Logger _logger; late Logger _logger;
Log() { Log() {
@ -26,63 +27,23 @@ class Log {
} }
static void info(dynamic msg, [dynamic error, StackTrace? stackTrace]) { static void info(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) { rust_log(0, toNativeUtf8(msg));
log(0, toNativeUtf8(msg));
} else {
Log.shared._logger.i(
msg,
error: error,
stackTrace: stackTrace,
);
}
} }
static void debug(dynamic msg, [dynamic error, StackTrace? stackTrace]) { static void debug(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) { rust_log(1, toNativeUtf8(msg));
log(1, toNativeUtf8(msg));
} else {
Log.shared._logger.d(
msg,
error: error,
stackTrace: stackTrace,
);
}
} }
static void warn(dynamic msg, [dynamic error, StackTrace? stackTrace]) { static void warn(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) { rust_log(3, toNativeUtf8(msg));
log(3, toNativeUtf8(msg));
} else {
Log.shared._logger.w(
msg,
error: error,
stackTrace: stackTrace,
);
}
} }
static void trace(dynamic msg, [dynamic error, StackTrace? stackTrace]) { static void trace(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) { rust_log(2, toNativeUtf8(msg));
log(2, toNativeUtf8(msg));
} else {
Log.shared._logger.t(
msg,
error: error,
stackTrace: stackTrace,
);
}
} }
static void error(dynamic msg, [dynamic error, StackTrace? stackTrace]) { static void error(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) { rust_log(4, toNativeUtf8(msg));
log(4, toNativeUtf8(msg));
} else {
Log.shared._logger.e(
msg,
error: error,
stackTrace: stackTrace,
);
}
} }
} }

View File

@ -14,6 +14,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void); void link_me_please(void);
void backend_log(int64_t level, const char *data); void rust_log(int64_t level, const char *data);
void set_env(const char *data); void set_env(const char *data);

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void); void link_me_please(void);
void backend_log(int64_t level, const char *data); void rust_log(int64_t level, const char *data);
void set_env(const char *data); void set_env(const char *data);

View File

@ -162,7 +162,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -714,7 +714,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -818,7 +818,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -840,7 +840,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -869,7 +869,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -888,7 +888,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -903,7 +903,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -940,7 +940,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -979,7 +979,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1202,7 +1202,7 @@ dependencies = [
"cssparser-macros", "cssparser-macros",
"dtoa-short", "dtoa-short",
"itoa 1.0.6", "itoa 1.0.6",
"phf 0.11.2", "phf 0.8.0",
"smallvec", "smallvec",
] ]
@ -1313,7 +1313,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1744,6 +1744,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"serde_repr", "serde_repr",
"sysinfo",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tracing", "tracing",
@ -2586,7 +2587,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2603,7 +2604,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -3058,7 +3059,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -3715,6 +3716,15 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"
[[package]]
name = "ntapi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "nu-ansi-term" name = "nu-ansi-term"
version = "0.46.0" version = "0.46.0"
@ -4759,9 +4769,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
[[package]] [[package]]
name = "rayon" name = "rayon"
version = "1.7.0" version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
dependencies = [ dependencies = [
"either", "either",
"rayon-core", "rayon-core",
@ -4769,20 +4779,18 @@ dependencies = [
[[package]] [[package]]
name = "rayon-core" name = "rayon-core"
version = "1.11.0" version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [ dependencies = [
"crossbeam-channel",
"crossbeam-deque", "crossbeam-deque",
"crossbeam-utils", "crossbeam-utils",
"num_cpus",
] ]
[[package]] [[package]]
name = "realtime-entity" name = "realtime-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -4806,7 +4814,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-protocol" name = "realtime-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -5454,7 +5462,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -5720,6 +5728,21 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "sysinfo"
version = "0.30.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"windows 0.52.0",
]
[[package]] [[package]]
name = "system-configuration" name = "system-configuration"
version = "0.5.1" version = "0.5.1"
@ -6934,7 +6957,7 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -7051,6 +7074,16 @@ dependencies = [
"windows-targets 0.48.0", "windows-targets 0.48.0",
] ]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.52.0",
]
[[package]] [[package]]
name = "windows-bindgen" name = "windows-bindgen"
version = "0.39.0" version = "0.39.0"
@ -7061,6 +7094,15 @@ dependencies = [
"windows-tokens", "windows-tokens",
] ]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]] [[package]]
name = "windows-implement" name = "windows-implement"
version = "0.39.0" version = "0.39.0"
@ -7334,7 +7376,7 @@ dependencies = [
[[package]] [[package]]
name = "workspace-template" name = "workspace-template"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -82,7 +82,7 @@ custom-protocol = ["tauri/custom-protocol"]
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "375318774a53e2056b1d693b231eee3336ad1937" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -92,10 +92,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }

View File

@ -221,7 +221,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -545,7 +545,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -618,7 +618,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -640,7 +640,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -659,7 +659,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -674,7 +674,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -711,7 +711,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -749,7 +749,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -901,7 +901,7 @@ dependencies = [
"cssparser-macros", "cssparser-macros",
"dtoa-short", "dtoa-short",
"itoa", "itoa",
"phf 0.11.2", "phf 0.8.0",
"smallvec", "smallvec",
] ]
@ -946,7 +946,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1292,6 +1292,7 @@ dependencies = [
"bytes", "bytes",
"client-api", "client-api",
"collab-document", "collab-document",
"collab-folder",
"collab-plugins", "collab-plugins",
"fancy-regex 0.11.0", "fancy-regex 0.11.0",
"flowy-codegen", "flowy-codegen",
@ -1699,7 +1700,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -1716,7 +1717,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2050,7 +2051,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -2779,7 +2780,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
dependencies = [ dependencies = [
"phf_macros 0.8.0", "phf_macros",
"phf_shared 0.8.0", "phf_shared 0.8.0",
"proc-macro-hack", "proc-macro-hack",
] ]
@ -2799,7 +2800,6 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
dependencies = [ dependencies = [
"phf_macros 0.11.2",
"phf_shared 0.11.2", "phf_shared 0.11.2",
] ]
@ -2867,19 +2867,6 @@ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "phf_macros"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
dependencies = [
"phf_generator 0.11.2",
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]] [[package]]
name = "phf_shared" name = "phf_shared"
version = "0.8.0" version = "0.8.0"
@ -3308,7 +3295,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-entity" name = "realtime-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -3332,7 +3319,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-protocol" name = "realtime-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -3779,7 +3766,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -4721,7 +4708,7 @@ checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -5028,4 +5015,4 @@ dependencies = [
[[patch.unused]] [[patch.unused]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"

View File

@ -55,7 +55,7 @@ codegen-units = 1
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "375318774a53e2056b1d693b231eee3336ad1937" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -65,10 +65,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }

View File

@ -163,7 +163,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -673,7 +673,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -746,7 +746,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -768,7 +768,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -797,7 +797,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -816,7 +816,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -831,7 +831,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -868,7 +868,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -907,7 +907,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1237,7 +1237,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1731,6 +1731,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"serde_repr", "serde_repr",
"sysinfo",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tracing", "tracing",
@ -2410,7 +2411,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2427,7 +2428,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2698,7 +2699,7 @@ dependencies = [
"iana-time-zone-haiku", "iana-time-zone-haiku",
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
"windows", "windows 0.48.0",
] ]
[[package]] [[package]]
@ -2821,7 +2822,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -3319,6 +3320,15 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"
[[package]]
name = "ntapi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "nu-ansi-term" name = "nu-ansi-term"
version = "0.46.0" version = "0.46.0"
@ -4265,9 +4275,9 @@ dependencies = [
[[package]] [[package]]
name = "rayon" name = "rayon"
version = "1.7.0" version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
dependencies = [ dependencies = [
"either", "either",
"rayon-core", "rayon-core",
@ -4275,14 +4285,12 @@ dependencies = [
[[package]] [[package]]
name = "rayon-core" name = "rayon-core"
version = "1.11.0" version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [ dependencies = [
"crossbeam-channel",
"crossbeam-deque", "crossbeam-deque",
"crossbeam-utils", "crossbeam-utils",
"num_cpus",
] ]
[[package]] [[package]]
@ -4297,7 +4305,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-entity" name = "realtime-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -4321,7 +4329,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-protocol" name = "realtime-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -4909,7 +4917,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -5149,6 +5157,21 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "sysinfo"
version = "0.30.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"windows 0.52.0",
]
[[package]] [[package]]
name = "system-configuration" name = "system-configuration"
version = "0.5.1" version = "0.5.1"
@ -6084,7 +6107,7 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -6160,6 +6183,25 @@ dependencies = [
"windows-targets 0.48.5", "windows-targets 0.48.5",
] ]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.52.0",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.48.0" version = "0.48.0"
@ -6305,7 +6347,7 @@ dependencies = [
[[package]] [[package]]
name = "workspace-template" name = "workspace-template"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -105,7 +105,7 @@ incremental = false
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "375318774a53e2056b1d693b231eee3336ad1937" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -115,10 +115,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void); void link_me_please(void);
void backend_log(int64_t level, const char *data); void rust_log(int64_t level, const char *data);
void set_env(const char *data); void set_env(const char *data);

View File

@ -5,7 +5,7 @@ use std::{ffi::CStr, os::raw::c_char};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use parking_lot::Mutex; use parking_lot::Mutex;
use tracing::{error, trace}; use tracing::{debug, error, info, trace, warn};
use flowy_core::config::AppFlowyCoreConfig; use flowy_core::config::AppFlowyCoreConfig;
use flowy_core::*; use flowy_core::*;
@ -175,18 +175,51 @@ async fn post_to_flutter(response: AFPluginEventResponse, port: i64) {
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn backend_log(level: i64, data: *const c_char) { pub extern "C" fn rust_log(level: i64, data: *const c_char) {
let c_str = unsafe { CStr::from_ptr(data) }; info!("backend_log");
let log_str = c_str.to_str().unwrap(); // Check if the data pointer is not null
if data.is_null() {
error!("[flutter error]: null pointer provided to backend_log");
return;
}
// Don't change the mapping relation between number and level let log_result = unsafe { CStr::from_ptr(data) }.to_str();
match level {
0 => tracing::info!("{}", log_str), // Handle potential UTF-8 conversion error
1 => tracing::debug!("{}", log_str), let log_str = match log_result {
2 => tracing::trace!("{}", log_str), Ok(str) => str,
3 => tracing::warn!("{}", log_str), Err(e) => {
4 => tracing::error!("{}", log_str), error!(
_ => (), "[flutter error]: Failed to convert C string to Rust string: {:?}",
e
);
return;
},
};
// Simplify logging by determining the log level outside of the match
let log_level = match level {
0 => "info",
1 => "debug",
2 => "trace",
3 => "warn",
4 => "error",
_ => {
warn!("[flutter error]: Unsupported log level: {}", level);
return;
},
};
// Log the message at the appropriate level
match log_level {
"info" => info!("[Flutter]: {}", log_str),
"debug" => debug!("[Flutter]: {}", log_str),
"trace" => trace!("[Flutter]: {}", log_str),
"warn" => warn!("[Flutter]: {}", log_str),
"error" => error!("[Flutter]: {}", log_str),
_ => {
warn!("[flutter error]: Unsupported log level: {}", log_level);
},
} }
} }

View File

@ -47,6 +47,7 @@ serde_json.workspace = true
serde_repr.workspace = true serde_repr.workspace = true
futures.workspace = true futures.workspace = true
walkdir = "2.4.0" walkdir = "2.4.0"
sysinfo = "0.30.5"
[features] [features]
default = ["rev-sqlite"] default = ["rev-sqlite"]

View File

@ -3,6 +3,7 @@
use flowy_storage::ObjectStorageService; use flowy_storage::ObjectStorageService;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use sysinfo::System;
use tokio::sync::RwLock; use tokio::sync::RwLock;
use tracing::{debug, error, event, info, instrument}; use tracing::{debug, error, event, info, instrument};
@ -79,6 +80,8 @@ impl AppFlowyCore {
// Init the key value database // Init the key value database
let store_preference = Arc::new(StorePreferences::new(&config.storage_path).unwrap()); let store_preference = Arc::new(StorePreferences::new(&config.storage_path).unwrap());
info!("🔥{:?}", &config); info!("🔥{:?}", &config);
info!("💡System info: {:?}", System::long_os_version());
let task_scheduler = TaskDispatcher::new(Duration::from_secs(2)); let task_scheduler = TaskDispatcher::new(Duration::from_secs(2));
let task_dispatcher = Arc::new(RwLock::new(task_scheduler)); let task_dispatcher = Arc::new(RwLock::new(task_scheduler));
runtime.spawn(TaskRunner::run(task_dispatcher.clone())); runtime.spawn(TaskRunner::run(task_dispatcher.clone()));

View File

@ -132,7 +132,7 @@ impl DocumentManager {
/// Returns Document for given object id /// Returns Document for given object id
/// If the document does not exist in local disk, try get the doc state from the cloud. /// If the document does not exist in local disk, try get the doc state from the cloud.
/// If the document exists, open the document and cache it /// If the document exists, open the document and cache it
#[tracing::instrument(level = "debug", skip(self), err)] #[tracing::instrument(level = "info", skip(self), err)]
pub async fn get_document(&self, doc_id: &str) -> FlowyResult<Arc<MutexDocument>> { pub async fn get_document(&self, doc_id: &str) -> FlowyResult<Arc<MutexDocument>> {
if let Some(doc) = self.documents.lock().get(doc_id).cloned() { if let Some(doc) = self.documents.lock().get(doc_id).cloned() {
return Ok(doc); return Ok(doc);

View File

@ -1,5 +1,6 @@
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration;
use anyhow::Error; use anyhow::Error;
use client_api::collab_sync::collab_msg::CollabMessage; use client_api::collab_sync::collab_msg::CollabMessage;
@ -262,6 +263,9 @@ fn spawn_ws_conn(
if enable_sync.load(Ordering::SeqCst) { if enable_sync.load(Ordering::SeqCst) {
match api_client.ws_url(&cloned_device_id).await { match api_client.ws_url(&cloned_device_id).await {
Ok(ws_addr) => { Ok(ws_addr) => {
// sleep two seconds and then try to reconnect
tokio::time::sleep(Duration::from_secs(2)).await;
event!(tracing::Level::INFO, "🟢reconnecting websocket"); event!(tracing::Level::INFO, "🟢reconnecting websocket");
let _ = ws_client.connect(ws_addr, &cloned_device_id).await; let _ = ws_client.connect(ws_addr, &cloned_device_id).await;
}, },

View File

@ -5,6 +5,7 @@ use serde_json::Value;
use tracing::{Event, Id, Subscriber}; use tracing::{Event, Id, Subscriber};
use tracing_bunyan_formatter::JsonStorage; use tracing_bunyan_formatter::JsonStorage;
use tracing_core::metadata::Level; use tracing_core::metadata::Level;
use tracing_core::span::Attributes;
use tracing_subscriber::{fmt::MakeWriter, layer::Context, registry::SpanRef, Layer}; use tracing_subscriber::{fmt::MakeWriter, layer::Context, registry::SpanRef, Layer};
const LEVEL: &str = "level"; const LEVEL: &str = "level";
@ -31,7 +32,7 @@ where
pub fn new(make_writer: W) -> Self { pub fn new(make_writer: W) -> Self {
Self { Self {
make_writer, make_writer,
with_target: false, with_target: true,
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
} }
} }
@ -63,8 +64,8 @@ where
map_serializer.serialize_entry("target", &span.metadata().target())?; map_serializer.serialize_entry("target", &span.metadata().target())?;
} }
map_serializer.serialize_entry("line", &span.metadata().line())?; // map_serializer.serialize_entry("line", &span.metadata().line())?;
map_serializer.serialize_entry("file", &span.metadata().file())?; // map_serializer.serialize_entry("file", &span.metadata().file())?;
let extensions = span.extensions(); let extensions = span.extensions();
if let Some(visitor) = extensions.get::<JsonStorage>() { if let Some(visitor) = extensions.get::<JsonStorage>() {
@ -102,9 +103,9 @@ pub enum Type {
impl fmt::Display for Type { impl fmt::Display for Type {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let repr = match self { let repr = match self {
Type::EnterSpan => "Start", Type::EnterSpan => "START",
Type::ExitSpan => "End", Type::ExitSpan => "END",
Type::Event => "Event", Type::Event => "EVENT",
}; };
write!(f, "{}", repr) write!(f, "{}", repr)
} }
@ -113,19 +114,12 @@ impl fmt::Display for Type {
fn format_span_context<'b, S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>>( fn format_span_context<'b, S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>>(
span: &SpanRef<'b, S>, span: &SpanRef<'b, S>,
ty: Type, ty: Type,
context: &Context<'_, S>, _: &Context<'_, S>,
) -> String { ) -> String {
match context.lookup_current() { if matches!(ty, Type::EnterSpan) {
None => { format!("[🟢 {} - {}]", span.metadata().name().to_uppercase(), ty)
if matches!(ty, Type::EnterSpan) { } else {
format!("[🟢 {} - {}]", span.metadata().name().to_uppercase(), ty) format!("[{} - {}]", span.metadata().name().to_uppercase(), ty)
} else {
format!("[🔵 {} - {}]", span.metadata().name().to_uppercase(), ty)
}
},
Some(_) => {
format!("[{} - {}]", span.metadata().name().to_uppercase(), ty)
},
} }
} }
@ -227,6 +221,13 @@ where
} }
} }
fn on_new_span(&self, _attrs: &Attributes, id: &Id, ctx: Context<'_, S>) {
let span = ctx.span(id).expect("Span not found, this is a bug");
if let Ok(serialized) = self.serialize_span(&span, Type::EnterSpan, &ctx) {
let _ = self.emit(serialized);
}
}
fn on_close(&self, id: Id, ctx: Context<'_, S>) { fn on_close(&self, id: Id, ctx: Context<'_, S>) {
let span = ctx.span(&id).expect("Span not found, this is a bug"); let span = ctx.span(&id).expect("Span not found, this is a bug");
if let Ok(serialized) = self.serialize_span(&span, Type::ExitSpan, &ctx) { if let Ok(serialized) = self.serialize_span(&span, Type::ExitSpan, &ctx) {

View File

@ -55,7 +55,6 @@ impl Builder {
let subscriber = tracing_subscriber::fmt() let subscriber = tracing_subscriber::fmt()
.with_timer(CustomTime) .with_timer(CustomTime)
.with_ansi(true) .with_ansi(true)
.with_target(false)
.with_max_level(tracing::Level::TRACE) .with_max_level(tracing::Level::TRACE)
.with_thread_ids(false) .with_thread_ids(false)
.pretty() .pretty()