/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/kbfs/libfuse/debug.go
55 строк
1 KB
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. // //go:build !windows package libfuse import ( "fmt" "regexp" "github.com/keybase/client/go/libkb" "github.com/keybase/client/go/logger" ) var statfsOrAccessRegexp = regexp.MustCompile(`^(<-|->).* (Statfs|Access)`) // MakeFuseDebugFn returns a function that logs its argument to the // given log, suitable to assign to fuse.Debug. func MakeFuseDebugFn( log logger.Logger, superVerbose bool, ) func(msg any) { return func(msg any) { str := fmt.Sprintf("%s", msg) // If superVerbose is not set, filter out Statfs and // Access messages, since they're spammy on OS X. // // Ideally, bazil would let us filter this better, and // also pass in the ctx. if !superVerbose && statfsOrAccessRegexp.MatchString(str) { return } log.Debug("%s", str) } } // MakeFuseVDebugFn returns a function that logs its argument to the // given vlog at level 1, suitable to assign to fuse.Debug. func MakeFuseVDebugFn( vlog *libkb.VDebugLog, superVerbose bool, ) func(msg any) { return func(msg any) { str := fmt.Sprintf("%s", msg) // If superVerbose is not set, filter out Statfs and // Access messages, since they're spammy on OS X. // // Ideally, bazil would let us filter this better, and // also pass in the ctx. if !superVerbose && statfsOrAccessRegexp.MatchString(str) { return } vlog.Log(libkb.VLog1, "%s", str) } }