Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
6cee88f6
Unverified
Commit
6cee88f6
authored
Nov 22, 2017
by
keks
Committed by
GitHub
Nov 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22 from ipfs/feat/uuid-logging
Added uuid loggable (requestId) to root context
parents
57aac50b
904cd897
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
http/handler.go
http/handler.go
+5
-5
package.json
package.json
+6
-0
No files found.
http/handler.go
View file @
6cee88f6
package
http
import
(
"context"
"errors"
"fmt"
"net/http"
...
...
@@ -9,13 +10,11 @@ import (
"strings"
"sync"
context
"context
"
"github.com/ipfs/go-ipfs-cmds
"
"github.com/ipfs/go-ipfs/repo/config"
cors
"github.com/rs/cors"
cmds
"github.com/ipfs/go-ipfs-cmds"
logging
"github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p-loggables"
"github.com/rs/cors"
)
var
log
=
logging
.
Logger
(
"cmds/http"
)
...
...
@@ -139,6 +138,7 @@ func (i internalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx
,
cancel
:=
context
.
WithCancel
(
node
.
Context
())
defer
cancel
()
ctx
=
logging
.
ContextWithLoggable
(
ctx
,
loggables
.
Uuid
(
"requestId"
))
if
cn
,
ok
:=
w
.
(
http
.
CloseNotifier
);
ok
{
clientGone
:=
cn
.
CloseNotify
()
go
func
()
{
...
...
package.json
View file @
6cee88f6
...
...
@@ -28,6 +28,12 @@
"hash"
:
"QmUyfy4QSr3NXym4etEiRyxBLqqAeKHJuRdi8AACxg63fZ"
,
"name"
:
"go-ipfs-cmdkit"
,
"version"
:
"0.3.5"
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"QmT4PgCNdv73hnFAqzHqwW44q7M9PWpykSswHDxndquZbc"
,
"name"
:
"go-libp2p-loggables"
,
"version"
:
"1.1.8"
}
],
"gxVersion"
:
"0.10.0"
,
...
...
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