Skip to content

Commit fe3cc37

Browse files
committed
remove verbose logging v1
1 parent 7ea9d5a commit fe3cc37

File tree

8 files changed

+15
-14
lines changed

8 files changed

+15
-14
lines changed

api/websocket.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package api
22

33
import (
4-
"fmt"
5-
"github.com/gin-gonic/gin"
6-
"github.com/gorilla/websocket"
74
"net/http"
85
"proofofaccess/localdata"
96
"sync"
7+
8+
"github.com/gin-gonic/gin"
9+
"github.com/gorilla/websocket"
1010
)
1111

1212
type ExampleResponse struct {
@@ -68,7 +68,7 @@ func readWebSocketMessage(conn *websocket.Conn) (*message, error) {
6868

6969
func sendWsResponse(status string, message string, elapsed string, conn *websocket.Conn) {
7070
localdata.Lock.Lock()
71-
fmt.Println("sendWsResponse", status, message, elapsed)
71+
//fmt.Println("sendWsResponse", status, message, elapsed)
7272
err := conn.WriteJSON(ExampleResponse{
7373
Status: status,
7474
Message: message,

connection/connection.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"github.com/gorilla/websocket"
87
"log"
98
"os"
109
"os/signal"
1110
"proofofaccess/localdata"
1211
"proofofaccess/messaging"
1312
"proofofaccess/proofcrypto"
1413
"time"
14+
15+
"github.com/gorilla/websocket"
1516
)
1617

1718
const (
@@ -201,7 +202,7 @@ func wsPing(hash string, name string, c *websocket.Conn) {
201202
fmt.Println("Error encoding JSON:", err)
202203
return
203204
}
204-
fmt.Println("Client send: ", string(jsonData))
205+
//fmt.Println("Client send: ", string(jsonData))
205206
err = c.WriteMessage(websocket.TextMessage, jsonData)
206207
if err != nil {
207208
log.Printf("write ping: %v", err)

data/badger/000000.vlog

507 Bytes
Binary file not shown.

data/badger/000006.sst

407 Bytes
Binary file not shown.

data/badger/MANIFEST

328 Bytes
Binary file not shown.

honeycomb/honeycomb.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package honeycomb
22

33
import (
44
"encoding/json"
5-
"fmt"
65
"io/ioutil"
76
"net/http"
87
)
@@ -17,7 +16,7 @@ type Contract struct {
1716

1817
func GetCIDsFromAPI(url string) ([]string, error) {
1918
resp, err := http.Get(url)
20-
fmt.Println("resp", resp)
19+
// fmt.Println("resp", resp)
2120
if err != nil {
2221
return nil, err
2322
}
@@ -32,12 +31,12 @@ func GetCIDsFromAPI(url string) ([]string, error) {
3231
if err := json.Unmarshal(body, &response); err != nil {
3332
return nil, err
3433
}
35-
fmt.Println("response", response)
34+
//fmt.Println("response", response)
3635
var cids []string
3736
for _, contracts := range response.Contracts {
3837
for _, contract := range contracts {
3938
for cid := range contract.DF {
40-
fmt.Println("Contract CID", cid)
39+
//fmt.Println("Contract CID", cid)
4140
cids = append(cids, cid)
4241
}
4342
}

main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"context"
55
"flag"
66
"fmt"
7-
shell "github.com/ipfs/go-ipfs-api"
8-
"github.com/sirupsen/logrus"
97
"os"
108
"os/signal"
119
"proofofaccess/Rewards"
@@ -21,6 +19,9 @@ import (
2119
"proofofaccess/validators"
2220
"sync"
2321
"syscall"
22+
23+
shell "github.com/ipfs/go-ipfs-api"
24+
"github.com/sirupsen/logrus"
2425
)
2526

2627
var (
@@ -46,7 +47,7 @@ var mu sync.Mutex
4647

4748
func main() {
4849
flag.Parse()
49-
50+
log.SetLevel(logrus.WarnLevel)
5051
ipfs.Shell = shell.NewShell("localhost:" + *ipfsPort)
5152
ctx, cancel := context.WithCancel(context.Background())
5253

@@ -98,7 +99,7 @@ func initialize(ctx context.Context) {
9899
localdata.Lock.Unlock()
99100
log.Error(err)
100101
fmt.Println("Got Honeycomb CIDs")
101-
fmt.Println(cids)
102+
// fmt.Println(cids)
102103
go ipfs.SaveRefs(cids)
103104
}
104105
if *nodeType == 1 {

proofofaccess

20.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)