Browse Source

Improve log message consistency

Jakob Borg 12 years ago
parent
commit
ec0489a8ea
5 changed files with 13 additions and 11 deletions
  1. 7 3
      README.md
  2. 2 2
      main.go
  3. 1 3
      model.go
  4. 1 1
      model_puller.go
  5. 2 2
      tls.go

+ 7 - 3
README.md

@@ -115,8 +115,8 @@ Run syncthing to let it create it's config directory and certificate:
 ```
 $ syncthing
 11:34:13 main.go:85: INFO: Version v0.1-40-gbb0fd87
-11:34:13 tls.go:61: OK: wrote cert.pem
-11:34:13 tls.go:67: OK: wrote key.pem
+11:34:13 tls.go:61: OK: Created TLS certificate file
+11:34:13 tls.go:67: OK: Created TLS key file
 11:34:13 main.go:66: INFO: My ID: NCTBZAAHXR6ZZP3D7SL3DLYFFQERMW4Q
 11:34:13 main.go:90: FATAL: No config file
 ```
@@ -159,8 +159,12 @@ $ syncthing --ro
 13:30:59 main.go:247: INFO: Starting local discovery
 13:30:59 main.go:165: OK: Ready to synchronize
 13:31:04 discover.go:113: INFO: Discovered node CUGAE43Y5N64CRJU26YFH6MTWPSBLSUL at 172.16.32.24:22000
-13:31:14 main.go:296: OK: Connected to node CUGAE43Y5N64CRJU26YFH6MTWPSBLSUL
+13:31:14 main.go:296: INFO: Connected to node CUGAE43Y5N64CRJU26YFH6MTWPSBLSUL
 13:31:19 main.go:345: INFO: Transferred 139 KiB in (14 KiB/s), 139 KiB out (14 KiB/s)
+13:32:20 model.go:94: INFO: CUGAE43Y5N64CRJU26YFH6MTWPSBLSUL: 263.4 KB/s in, 69.1 KB/s out
+13:32:20 model.go:104: INFO:  18289 files,  24.24 GB in cluster
+13:32:20 model.go:111: INFO:  17132 files,  22.39 GB in local repo
+13:32:20 model.go:117: INFO:   1157 files,   1.84 GB to synchronize
 ...
 ```
 You should see the synchronization start and then finish a short while

+ 2 - 2
main.go

@@ -216,7 +216,7 @@ listen:
 			if nodeID == remoteID {
 				nc := protocol.NewConnection(remoteID, conn, conn, m)
 				m.AddNode(nc)
-				okln("Connected to nodeID", remoteID, "(in)")
+				infoln("Connected to node", remoteID, "(in)")
 				continue listen
 			}
 		}
@@ -287,7 +287,7 @@ func connect(myID string, addr string, nodeAddrs map[string][]string, m *Model,
 
 				nc := protocol.NewConnection(nodeID, conn, conn, m)
 				m.AddNode(nc)
-				okln("Connected to node", remoteID, "(out)")
+				infoln("Connected to node", remoteID, "(out)")
 				continue nextNode
 			}
 		}

+ 1 - 3
model.go

@@ -199,9 +199,7 @@ func (m *Model) Close(node string) {
 	m.Lock()
 	defer m.Unlock()
 
-	if opts.Debug.TraceNet {
-		debugf("NET CLOSE: %s", node)
-	}
+	infoln("Disconnected from node", node)
 
 	delete(m.remote, node)
 	delete(m.nodes, node)

+ 1 - 1
model_puller.go

@@ -110,7 +110,7 @@ func (m *Model) pullFile(name string) error {
 
 	err = hashCheck(tmpFilename, globalFile.Blocks)
 	if err != nil {
-		return fmt.Errorf("%s: %s", path.Base(name), err.Error())
+		return fmt.Errorf("%s: %s (deleting)", path.Base(name), err.Error())
 	}
 
 	err = os.Chtimes(tmpFilename, time.Unix(globalFile.Modified, 0), time.Unix(globalFile.Modified, 0))

+ 2 - 2
tls.go

@@ -58,11 +58,11 @@ func newCertificate(dir string) {
 	fatalErr(err)
 	pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})
 	certOut.Close()
-	okln("wrote cert.pem")
+	okln("Created TLS certificate file")
 
 	keyOut, err := os.OpenFile(path.Join(dir, "key.pem"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
 	fatalErr(err)
 	pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)})
 	keyOut.Close()
-	okln("wrote key.pem")
+	okln("Created TLS key file")
 }