Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2554452

Browse filesBrowse files
authored
Merge pull request #110 from arduino/log_micros
Added logging of LSP calls duration and increased resolution of timestamps
2 parents 22ca780 + e30d0e4 commit 2554452
Copy full SHA for 2554452

File tree

Expand file treeCollapse file tree

3 files changed

+14
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+14
-5
lines changed

‎go.mod

Copy file name to clipboardExpand all lines: go.mod
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ require (
99
github.com/pkg/errors v0.9.1
1010
github.com/stretchr/testify v1.7.0
1111
go.bug.st/json v1.15.6
12-
go.bug.st/lsp v0.0.0-20211202163946-3ad3994172a0
12+
go.bug.st/lsp v0.0.0-20220608135618-8a2f8eb9ad1b
1313
google.golang.org/grpc v1.42.0
1414
)

‎go.sum

Copy file name to clipboardExpand all lines: go.sum
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,8 @@ go.bug.st/downloader/v2 v2.1.1 h1:nyqbUizo3E2IxCCm4YFac4FtSqqFpqWP+Aae5GCMuw4=
337337
go.bug.st/downloader/v2 v2.1.1/go.mod h1:VZW2V1iGKV8rJL2ZEGIDzzBeKowYv34AedJz13RzVII=
338338
go.bug.st/json v1.15.6 h1:pvSpotu6f5JoCbx1TnKn6asVH7o9Tg2/GKsZSVzBOsc=
339339
go.bug.st/json v1.15.6/go.mod h1:bh58F9adz5ePlNqtvbuXuXcf9k6IrDLKH6lJUsHP3TI=
340-
go.bug.st/lsp v0.0.0-20211130152916-c597b0a0439f h1:Rj7FdBdROWh9mMra/16G/5d7u/QE0Wwq487NZt+Evjg=
341-
go.bug.st/lsp v0.0.0-20211130152916-c597b0a0439f/go.mod h1:oYTh1uf5hI1teV5crrWut41Pk8vD/NqIjs4zD+No5FE=
342-
go.bug.st/lsp v0.0.0-20211202163946-3ad3994172a0 h1:/SnZ7aZ3bmfUKWbhckiK6L4mv9vyf9HgwV6X0dm+/is=
343-
go.bug.st/lsp v0.0.0-20211202163946-3ad3994172a0/go.mod h1:oYTh1uf5hI1teV5crrWut41Pk8vD/NqIjs4zD+No5FE=
340+
go.bug.st/lsp v0.0.0-20220608135618-8a2f8eb9ad1b h1:JkRunYlYDXFIgMf3BfgFrQyvHCsqkUuCGL9CUYhY3zc=
341+
go.bug.st/lsp v0.0.0-20220608135618-8a2f8eb9ad1b/go.mod h1:oYTh1uf5hI1teV5crrWut41Pk8vD/NqIjs4zD+No5FE=
344342
go.bug.st/relaxed-semver v0.0.0-20190922224835-391e10178d18 h1:F1qxtaFuewctYc/SsHRn+Q7Dtwi+yJGPgVq8YLtQz98=
345343
go.bug.st/relaxed-semver v0.0.0-20190922224835-391e10178d18/go.mod h1:Cx1VqMtEhE9pIkEyUj3LVVVPkv89dgW8aCKrRPDR/uE=
346344
go.bug.st/serial v1.3.2/go.mod h1:jDkjqASf/qSjmaOxHSHljwUQ6eHo/ZX/bxJLQqSlvZg=

‎ls/lsp_logger.go

Copy file name to clipboardExpand all lines: ls/lsp_logger.go
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ls
33
import (
44
"fmt"
55
"log"
6+
"time"
67

78
"github.com/fatih/color"
89
"go.bug.st/json"
@@ -15,6 +16,10 @@ type LSPLogger struct {
1516
ErrorColor func(format string, a ...interface{}) string
1617
}
1718

19+
func init() {
20+
log.SetFlags(log.Lmicroseconds)
21+
}
22+
1823
func (l *LSPLogger) LogOutgoingRequest(id string, method string, params json.RawMessage) {
1924
log.Print(l.HiColor("%s REQU %s %s", l.OutgoingPrefix, method, id))
2025
}
@@ -58,6 +63,12 @@ func (l *LSPLogger) LogIncomingNotification(method string, params json.RawMessag
5863
prefix: fmt.Sprintf("%s %s", spaces[:len(l.IncomingPrefix)], method),
5964
}
6065
}
66+
func (l *LSPLogger) LogIncomingDataDelay(delay time.Duration) {
67+
log.Printf("IN Elapsed: %v", delay)
68+
}
69+
func (l *LSPLogger) LogOutgoingDataDelay(delay time.Duration) {
70+
log.Printf("OUT Elapsed: %v", delay)
71+
}
6172

6273
type LSPFunctionLogger struct {
6374
colorFunc func(format string, a ...interface{}) string

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.