Skip to content

Commit 7d046f1

Browse files
refactor(Mountain): Move high-frequency logging to verbose/opt-in tags
Continue reducing default log volume by routing per-operation lines to dedicated verbose tags that are muted in `short` mode: 1. **Command registration**: `commands` → `commands-verbose` for setContext (~130/session) and command execution in CommandProvider 2. **Output channels**: `grpc` → `output-verbose` for append/create events (200+ appends per boot from language servers) 3. **Command registry**: `grpc` → `command-register` for register/unregister notifications (~100 commands/session) 4. **Provider registration**: `grpc`/extensions → `grpc-verbose`/`provider-register` for duplicate provider registration logs 5. **Extension scanning**: `extensions` → `ext-scan-verbose` for per-candidate package.json probes (203/session) 6. **Scheme assets**: `lifecycle` → `scheme-assets` for per-asset vscode-file:// requests (worker/wasm/font loading) New tags added to SHORT_MODE_MUTED_TAGS: output-verbose, command-register, provider-register, ext-scan-verbose, channel-stub, commands-verbose, scheme-assets.
1 parent 9aa0045 commit 7d046f1

11 files changed

Lines changed: 59 additions & 13 deletions

File tree

Source/ApplicationState/State/ExtensionState/ProviderRegistration/ProviderRegistration.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ impl Registration {
7474
pub fn RegisterProvider(&self, handle:u32, provider:ProviderRegistrationDTO) {
7575
if let Ok(mut guard) = self.LanguageProviders.lock() {
7676
guard.insert(handle, provider);
77+
// Duplicate of the `provider-register` log line emitted by
78+
// `MountainVinegRPCService`'s OR match - both fire per
79+
// provider registration. Route this one to
80+
// `provider-register` too (now short-muted) so the
81+
// `extensions` tag stays signal-only (scan start/end,
82+
// classification changes, install events).
7783
dev_log!(
78-
"extensions",
84+
"provider-register",
7985
"[ProviderRegistration] Provider registered with handle: {}",
8086
handle
8187
);

Source/Binary/Build/Scheme.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,12 @@ pub fn VscodeFileSchemeHandler<R:tauri::Runtime>(
739739
Request:&tauri::http::request::Request<Vec<u8>>,
740740
) -> Response<Vec<u8>> {
741741
let Uri = Request.uri().to_string();
742-
dev_log!("lifecycle", "[LandFix:VscodeFile] Request: {}", Uri);
742+
// Per-asset-request line - every `<img src="vscode-file://...">` +
743+
// worker / wasm / font in the workbench fires through here. The
744+
// `scheme-assets` line below (opt-in tag) already captures the
745+
// same data; duplicating under `lifecycle` at the default level
746+
// just floods the log.
747+
dev_log!("scheme-assets", "[LandFix:VscodeFile] Request: {}", Uri);
743748
dev_log!("scheme-assets", "[SchemeAssets] request uri={}", Uri);
744749

745750
// Extract path from: vscode-file://vscode-app/path/to/file
@@ -814,7 +819,7 @@ pub fn VscodeFileSchemeHandler<R:tauri::Runtime>(
814819
let AbsolutePath = format!("/{}", CleanPath);
815820
let FilesystemPath = std::path::Path::new(&AbsolutePath);
816821
dev_log!(
817-
"lifecycle",
822+
"scheme-assets",
818823
"[LandFix:VscodeFile] os-abs candidate {} (exists={}, is_file={})",
819824
AbsolutePath,
820825
FilesystemPath.exists(),
@@ -825,7 +830,7 @@ pub fn VscodeFileSchemeHandler<R:tauri::Runtime>(
825830
Ok(Bytes) => {
826831
let Mime = MimeFromExtension(&CleanPath);
827832
dev_log!(
828-
"lifecycle",
833+
"scheme-assets",
829834
"[LandFix:VscodeFile] os-abs served {} ({}, {} bytes)",
830835
AbsolutePath,
831836
Mime,

Source/Command/Bootstrap.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,11 @@ fn CommandSetContext(
347347
Argument:Value,
348348
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send>> {
349349
Box::pin(async move {
350-
dev_log!("commands", "[Native Command] setContext: {}", Argument);
350+
// setContext fires on every UI state change (focus, view toggle,
351+
// gitlens mode, SCM repo change). ~130 calls per session. Route
352+
// to `commands-verbose` so per-keypress context changes don't
353+
// flood the default log.
354+
dev_log!("commands-verbose", "[Native Command] setContext: {}", Argument);
351355
Ok(Value::Null)
352356
})
353357
}

Source/Environment/CommandProvider.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,13 @@ impl CommandExecutor for MountainEnvironment {
240240

241241
match HandlerInfoOption {
242242
Some(CommandHandler::Native(Function)) => {
243+
// Per-execution line. The setContext dominator is already
244+
// gated in Command/Bootstrap.rs; other native commands
245+
// (openWalkthrough, etc.) fire rarely enough that the
246+
// surviving tag volume is low, but `commands-verbose`
247+
// keeps this opt-in for consistency.
243248
dev_log!(
244-
"commands",
249+
"commands-verbose",
245250
"[CommandProvider] Executing NATIVE command '{}'.",
246251
CommandIdentifier
247252
);
@@ -262,7 +267,7 @@ impl CommandExecutor for MountainEnvironment {
262267

263268
Some(CommandHandler::Proxied { SideCarIdentifier, CommandIdentifier: ProxiedCommandIdentifier }) => {
264269
dev_log!(
265-
"commands",
270+
"commands-verbose",
266271
"[CommandProvider] Executing PROXIED command '{}' on sidecar '{}'.",
267272
CommandIdentifier,
268273
SideCarIdentifier

Source/ExtensionManagement/Scanner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,12 @@ pub async fn ScanDirectoryForExtensions(
288288

289289
let PackageJsonPath = PotentialExtensionPath.join("package.json");
290290

291+
// Per-candidate-directory probe, fires for every top-level
292+
// entry the scanner inspects (203 lines per session). The
293+
// accepted / rejected disposition is already covered by the
294+
// `ext-scan` tag below.
291295
dev_log!(
292-
"extensions",
296+
"ext-scan-verbose",
293297
"[ExtensionScanner] Checking for package.json in: {}",
294298
PotentialExtensionPath.display()
295299
);

Source/IPC/DevLog.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,13 @@ const SHORT_MODE_MUTED_TAGS:&[&str] = &[
616616
"storage-verbose",
617617
"config-prime",
618618
"cel-dispatch",
619+
"output-verbose",
620+
"command-register",
621+
"provider-register",
622+
"ext-scan-verbose",
623+
"channel-stub",
624+
"commands-verbose",
625+
"scheme-assets",
619626
];
620627

621628
/// Check if a tag is enabled.

Source/Vine/Server/MountainVinegRPCService.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,14 @@ impl MountainService for MountainVinegRPCService {
754754
.strip_prefix("register_")
755755
.map(|Stripped| Stripped.strip_suffix("_provider").unwrap_or(Stripped))
756756
.unwrap_or("");
757+
// The second `provider-register` dev_log below carries the
758+
// superset of fields (MethodName, scheme, extension id)
759+
// that make the line useful. The `grpc`-tagged copy here
760+
// was just the short form printed twice per register.
761+
// Route to `grpc-verbose` so the `short` log only shows
762+
// one line per provider registration.
757763
dev_log!(
758-
"grpc",
764+
"grpc-verbose",
759765
"[MountainVinegRPCService] Cocoon registered {} provider: handle={}, lang={}",
760766
ProviderTypeName,
761767
Handle,

Source/Vine/Server/Notification/OutputChannelAppend.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_
1010

1111
pub async fn OutputChannelAppend(Service:&MountainVinegRPCService, Parameter:&Value) {
1212
let _ = Service.ApplicationHandle().emit("sky://output/append", Parameter);
13+
// Per-append fire - `roo-cline`, `TypeScript`, `dart-code` all stream
14+
// stdout into their output channels which fires 200+ appends per
15+
// boot. The Sky-side consumer already sees the data via
16+
// `sky://output/append`; the tag line here adds no signal beyond
17+
// volume. Route to `output-verbose`.
1318
dev_log!(
14-
"grpc",
19+
"output-verbose",
1520
"[OutputChannel] append channel={}",
1621
Parameter.get("channel").and_then(Value::as_str).unwrap_or("?")
1722
);

Source/Vine/Server/Notification/OutputChannelCreate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_
1313
pub async fn OutputChannelCreate(Service:&MountainVinegRPCService, Parameter:&Value) {
1414
let _ = Service.ApplicationHandle().emit("sky://output/create", Parameter);
1515
dev_log!(
16-
"grpc",
16+
"output-verbose",
1717
"[OutputChannel] create id={}",
1818
Parameter.get("id").and_then(Value::as_str).unwrap_or("?")
1919
);

Source/Vine/Server/Notification/RegisterCommand.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ use crate::{
1616

1717
pub async fn RegisterCommand(Service:&MountainVinegRPCService, Parameter:&Value) {
1818
let CommandId = Parameter.get("commandId").and_then(Value::as_str).unwrap_or("");
19-
dev_log!("grpc", "[MountainVinegRPCService] Cocoon registered command: {}", CommandId);
19+
// Per-command registration (~100 commands / session). Useful for
20+
// verifying extension command contributions but noisy at the `grpc`
21+
// level. Route to `command-register` so it's opt-in alongside
22+
// `provider-register`.
23+
dev_log!("command-register", "[MountainVinegRPCService] Cocoon registered command: {}", CommandId);
2024
if CommandId.is_empty() {
2125
return;
2226
}

0 commit comments

Comments
 (0)