detached 5e0ca2d

fix(filtering): reduce verbose logging in hot paths

commit
5e0ca2d5c6021eb7706ea045f259d4befdc4a308
author
bnema · · 2025-11-29 11:46 UTC
parent
5ed8d0d
signature
GPG Unverified2B82207D370127A0 The key is unknown
1 file · +4 -4
M internal/filtering/service.go +4 -4
@@ -189,7 +189,7 @@ func (s *ContentBlockingService) injectCosmeticBaseScript(wv *pkgwebkit.WebView)
189189 return
190190 }
191191
192- logging.Info(fmt.Sprintf("[filtering] Injecting cosmetic base script into WebView %d (%d bytes)", wv.ID(), len(baseScript)))
192+ logging.Debug(fmt.Sprintf("[filtering] Injecting cosmetic base script into WebView %d (%d bytes)", wv.ID(), len(baseScript)))
193193
194194 // Inject at document-end when DOM is ready for querySelector/MutationObserver
195195 userScript := webkit.NewUserScript(
@@ -274,7 +274,7 @@ func (s *ContentBlockingService) applyNetworkFilters(wv *pkgwebkit.WebView, filt
274274 }
275275 s.mu.Unlock()
276276
277- logging.Info(fmt.Sprintf("[filtering] Applied network filters to WebView %d", wv.ID()))
277+ logging.Debug(fmt.Sprintf("[filtering] Applied network filters to WebView %d", wv.ID()))
278278 }
279279
280280 // setupCosmeticHooks sets up hooks for cosmetic filtering on navigation events.
@@ -318,12 +318,12 @@ func (s *ContentBlockingService) injectCosmeticRules(wv *pkgwebkit.WebView, uri
318318 }
319319
320320 // Inject the script
321- logging.Info(fmt.Sprintf("[filtering] Injecting cosmetic rules for domain: %s (%d bytes)", domain, len(script)))
321+ logging.Debug(fmt.Sprintf("[filtering] Injecting cosmetic rules for domain: %s (%d bytes)", domain, len(script)))
322322 pkgwebkit.RunOnMainThread(func() {
323323 if err := wv.InjectScript(script); err != nil {
324324 logging.Error(fmt.Sprintf("[filtering] Failed to inject cosmetic rules for %s: %v", domain, err))
325325 } else {
326- logging.Info(fmt.Sprintf("[filtering] Successfully injected cosmetic rules for domain: %s", domain))
326+ logging.Debug(fmt.Sprintf("[filtering] Successfully injected cosmetic rules for domain: %s", domain))
327327 }
328328 })
329329 }
@@ -189,7 +189,7 @@ func (s *ContentBlockingService) injectCosmeticBaseScript(wv *pkgwebkit.WebView)
189 return189 return
190 }190 }
191 191
192- logging.Info(fmt.Sprintf("[filtering] Injecting cosmetic base script into WebView %d (%d bytes)", wv.ID(), len(baseScript)))192+ logging.Debug(fmt.Sprintf("[filtering] Injecting cosmetic base script into WebView %d (%d bytes)", wv.ID(), len(baseScript)))
193 193
194 // Inject at document-end when DOM is ready for querySelector/MutationObserver194 // Inject at document-end when DOM is ready for querySelector/MutationObserver
195 userScript := webkit.NewUserScript(195 userScript := webkit.NewUserScript(
@@ -274,7 +274,7 @@ func (s *ContentBlockingService) applyNetworkFilters(wv *pkgwebkit.WebView, filt
274 }274 }
275 s.mu.Unlock()275 s.mu.Unlock()
276 276
277- logging.Info(fmt.Sprintf("[filtering] Applied network filters to WebView %d", wv.ID()))277+ logging.Debug(fmt.Sprintf("[filtering] Applied network filters to WebView %d", wv.ID()))
278 }278 }
279 279
280 // setupCosmeticHooks sets up hooks for cosmetic filtering on navigation events.280 // setupCosmeticHooks sets up hooks for cosmetic filtering on navigation events.
@@ -318,12 +318,12 @@ func (s *ContentBlockingService) injectCosmeticRules(wv *pkgwebkit.WebView, uri
318 }318 }
319 319
320 // Inject the script320 // Inject the script
321- logging.Info(fmt.Sprintf("[filtering] Injecting cosmetic rules for domain: %s (%d bytes)", domain, len(script)))321+ logging.Debug(fmt.Sprintf("[filtering] Injecting cosmetic rules for domain: %s (%d bytes)", domain, len(script)))
322 pkgwebkit.RunOnMainThread(func() {322 pkgwebkit.RunOnMainThread(func() {
323 if err := wv.InjectScript(script); err != nil {323 if err := wv.InjectScript(script); err != nil {
324 logging.Error(fmt.Sprintf("[filtering] Failed to inject cosmetic rules for %s: %v", domain, err))324 logging.Error(fmt.Sprintf("[filtering] Failed to inject cosmetic rules for %s: %v", domain, err))
325 } else {325 } else {
326- logging.Info(fmt.Sprintf("[filtering] Successfully injected cosmetic rules for domain: %s", domain))326+ logging.Debug(fmt.Sprintf("[filtering] Successfully injected cosmetic rules for domain: %s", domain))
327 }327 }
328 })328 })
329 }329 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close