filesystem/debug: improved NewServer#37
Open
jcrussell wants to merge 9 commits intoHarvey-OS:masterfrom
Open
Conversation
NewServer with callbacks based on functional options for friendly APIs. Replaces NewUFS. Add .Debug() to return a Debug-enabled version of the FileServer. Remove -root and -debug flags, use functional options instead. Most likely will conflict with Harvey-OS#32.
Based on NewServer rather than NewUFS.
Use NewServer rather than NewUFS.
Add debug.Server which wraps a NineServer and logs before and after calling functions for the underlying server. Add Trace option to protocol.Server. Makes Harvey-OS#34 obsolete
Sloppy merge, should have tested build afterwards.
Server.Trace was replaced by Trace option.
Set trace for the various servers to no-op log by default. Users can then change the trace function using the Trace option.
rminnich
approved these changes
Jun 13, 2018
| func Trace(tracer protocol.Tracer) ServerOpt { | ||
| return func(s *FileServer) error { | ||
| if tracer == nil { | ||
| return errors.New("tracer cannot be nil") |
There was a problem hiding this comment.
or, hey, in here,
tracer = func(string, ...interface{}) {}
for convenience, we can do that later.
Author
There was a problem hiding this comment.
I set tracer = nologf in NewServer, this seems like it should return an error if you try to pass nil as the tracer.
Should not be nil otherwise the *.Trace will return an error.
Forgot to s/File/file.
Author
|
Any thoughts on merging this? I noticed that #39 duplicates some of this PR. |
Closed
Member
|
We should look at merging this in. There are some conflicts due to more recent PRs being merged in first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several changes in this PR (rebase of #36):
ufs.NewServerwith callbacks based on functional options for friendly APIs.ufs.NewUFS.protocol.NineServer.debug.Serverandfilesystem.Server.