Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
5eb77598
Commit
5eb77598
authored
Jul 16, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Plain Diff
Killed off the --fuse.debug flag.
parents
069fff34
e1eaeb5b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
55 deletions
+23
-55
debug.go
debug.go
+0
-51
fuseops/ops.go
fuseops/ops.go
+1
-1
mounted_file_system.go
mounted_file_system.go
+9
-1
samples/in_process.go
samples/in_process.go
+7
-1
samples/mount_sample/mount.go
samples/mount_sample/mount.go
+5
-0
samples/subprocess.go
samples/subprocess.go
+1
-1
No files found.
debug.go
deleted
100644 → 0
View file @
069fff34
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package
fuse
import
(
"flag"
"io"
"io/ioutil"
"log"
"os"
"sync"
)
var
fEnableDebug
=
flag
.
Bool
(
"fuse.debug"
,
false
,
"Write FUSE debugging messages to stderr."
)
var
gDebugLogger
*
log
.
Logger
var
gDebugLoggerOnce
sync
.
Once
func
initDebugDebugLogger
()
{
if
!
flag
.
Parsed
()
{
panic
(
"initDebugDebugLogger called before flags available."
)
}
var
writer
io
.
Writer
=
ioutil
.
Discard
if
*
fEnableDebug
{
writer
=
os
.
Stderr
}
const
flags
=
log
.
Ldate
|
log
.
Ltime
|
log
.
Lmicroseconds
gDebugLogger
=
log
.
New
(
writer
,
""
,
flags
)
}
func
getDebugLogger
()
*
log
.
Logger
{
gDebugLoggerOnce
.
Do
(
initDebugDebugLogger
)
return
gDebugLogger
}
fuseops/ops.go
View file @
5eb77598
...
...
@@ -49,7 +49,7 @@ type Op interface {
// Log information tied to this operation, with semantics equivalent to
// log.Printf, except that the format is different and logging is suppressed
// if
--fuse.debug is not set
.
// if
no debug logger was set when mounting
.
Logf
(
format
string
,
v
...
interface
{})
}
...
...
mounted_file_system.go
View file @
5eb77598
...
...
@@ -84,6 +84,10 @@ type MountConfig struct {
// logging is performed.
ErrorLogger
*
log
.
Logger
// A logger to use for logging debug information. If nil, no debug logging is
// performed.
DebugLogger
*
log
.
Logger
// OS X only.
//
// Normally on OS X we mount with the novncache option
...
...
@@ -189,7 +193,11 @@ func Mount(
dir
string
,
server
Server
,
config
*
MountConfig
)
(
mfs
*
MountedFileSystem
,
err
error
)
{
debugLogger
:=
getDebugLogger
()
// Arrange for a non-nil debug logger.
debugLogger
:=
config
.
DebugLogger
if
debugLogger
==
nil
{
debugLogger
=
log
.
New
(
ioutil
.
Discard
,
""
,
0
)
}
// Initialize the struct.
mfs
=
&
MountedFileSystem
{
...
...
samples/in_process.go
View file @
5eb77598
...
...
@@ -18,6 +18,7 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"time"
...
...
@@ -59,7 +60,12 @@ type SampleTest struct {
//
// REQUIRES: t.Server has been set.
func
(
t
*
SampleTest
)
SetUp
(
ti
*
ogletest
.
TestInfo
)
{
err
:=
t
.
initialize
(
ti
.
Ctx
,
t
.
Server
,
&
t
.
MountConfig
)
cfg
:=
t
.
MountConfig
if
*
fDebug
{
cfg
.
DebugLogger
=
log
.
New
(
os
.
Stderr
,
"fuse: "
,
0
)
}
err
:=
t
.
initialize
(
ti
.
Ctx
,
t
.
Server
,
&
cfg
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
samples/mount_sample/mount.go
View file @
5eb77598
...
...
@@ -40,6 +40,7 @@ var fFlushError = flag.Int("flushfs.flush_error", 0, "")
var
fFsyncError
=
flag
.
Int
(
"flushfs.fsync_error"
,
0
,
""
)
var
fReadOnly
=
flag
.
Bool
(
"read_only"
,
false
,
"Mount in read-only mode."
)
var
fDebug
=
flag
.
Bool
(
"debug"
,
false
,
"Enable debug logging."
)
func
makeFlushFS
()
(
server
fuse
.
Server
,
err
error
)
{
// Check the flags.
...
...
@@ -140,6 +141,10 @@ func main() {
ReadOnly
:
*
fReadOnly
,
}
if
*
fDebug
{
cfg
.
DebugLogger
=
log
.
New
(
os
.
Stderr
,
"fuse: "
,
0
)
}
mfs
,
err
:=
fuse
.
Mount
(
*
fMountPoint
,
server
,
cfg
)
if
err
!=
nil
{
log
.
Fatalf
(
"Mount: %v"
,
err
)
...
...
samples/subprocess.go
View file @
5eb77598
...
...
@@ -276,7 +276,7 @@ func (t *SubprocessTest) initialize(ctx context.Context) (err error) {
// Handle debug mode.
if
*
fDebug
{
mountCmd
.
Stderr
=
os
.
Stderr
mountCmd
.
Args
=
append
(
mountCmd
.
Args
,
"--
fuse.
debug"
)
mountCmd
.
Args
=
append
(
mountCmd
.
Args
,
"--debug"
)
}
// Start the command.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment