Skip to content

Commit 8af084f

Browse files
committed
Replace Critical{,f} with Fatal{,f}
License: MIT Signed-off-by: rht <[email protected]>
1 parent efdd688 commit 8af084f

File tree

9 files changed

+12
-14
lines changed

9 files changed

+12
-14
lines changed

cmd/ipfs/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ func startProfiling() (func(), error) {
465465
for _ = range time.NewTicker(time.Second * 30).C {
466466
err := writeHeapProfileToFile()
467467
if err != nil {
468-
log.Critical(err)
468+
log.Fatal(err)
469469
}
470470
}
471471
}()

core/commands/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ output of a running daemon.
4545
// TODO use a different keyword for 'all' because all can theoretically
4646
// clash with a subsystem name
4747
cmds.StringArg("subsystem", true, false, fmt.Sprintf("the subsystem logging identifier. Use '%s' for all subsystems.", logAllKeyword)),
48-
cmds.StringArg("level", true, false, "one of: debug, info, notice, warning, error, critical"),
48+
cmds.StringArg("level", true, false, "one of: debug, info, notice, warning, error, fatal"),
4949
},
5050
Run: func(req cmds.Request, res cmds.Response) {
5151

fuse/ipns/ipns_unix.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,10 @@ func (dir *Directory) Rename(ctx context.Context, req *fuse.RenameRequest, newDi
462462
return err
463463
}
464464
case *File:
465-
log.Critical("Cannot move node into a file!")
465+
log.Fatal("Cannot move node into a file!")
466466
return fuse.EPERM
467467
default:
468-
log.Critical("Unknown node type for rename target dir!")
468+
log.Fatal("Unknown node type for rename target dir!")
469469
return errors.New("Unknown fs node type!")
470470
}
471471
return nil

ipnsfs/system.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (np *Republisher) Run(ctx context.Context) {
285285
log.Info("Publishing Changes!")
286286
err := np.root.Publish(ctx)
287287
if err != nil {
288-
log.Critical("republishRoot error: %s", err)
288+
log.Fatal("republishRoot error: %s", err)
289289
}
290290

291291
case <-ctx.Done():

p2p/test/util/key.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type TestBogusPrivateKey []byte
2424
type TestBogusPublicKey []byte
2525

2626
func (pk TestBogusPublicKey) Verify(data, sig []byte) (bool, error) {
27-
log.Criticalf("TestBogusPublicKey.Verify -- this better be a test!")
27+
log.Errorf("TestBogusPublicKey.Verify -- this better be a test!")
2828
return bytes.Equal(data, reverse(sig)), nil
2929
}
3030

@@ -33,7 +33,7 @@ func (pk TestBogusPublicKey) Bytes() ([]byte, error) {
3333
}
3434

3535
func (pk TestBogusPublicKey) Encrypt(b []byte) ([]byte, error) {
36-
log.Criticalf("TestBogusPublicKey.Encrypt -- this better be a test!")
36+
log.Errorf("TestBogusPublicKey.Encrypt -- this better be a test!")
3737
return reverse(b), nil
3838
}
3939

@@ -51,7 +51,7 @@ func (sk TestBogusPrivateKey) GenSecret() []byte {
5151
}
5252

5353
func (sk TestBogusPrivateKey) Sign(message []byte) ([]byte, error) {
54-
log.Criticalf("TestBogusPrivateKey.Sign -- this better be a test!")
54+
log.Errorf("TestBogusPrivateKey.Sign -- this better be a test!")
5555
return reverse(message), nil
5656
}
5757

@@ -60,7 +60,7 @@ func (sk TestBogusPrivateKey) GetPublic() ic.PubKey {
6060
}
6161

6262
func (sk TestBogusPrivateKey) Decrypt(b []byte) ([]byte, error) {
63-
log.Criticalf("TestBogusPrivateKey.Decrypt -- this better be a test!")
63+
log.Errorf("TestBogusPrivateKey.Decrypt -- this better be a test!")
6464
return reverse(b), nil
6565
}
6666

routing/dht/handlers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (dht *IpfsDHT) handleGetValue(ctx context.Context, p peer.ID, pmes *pb.Mess
8989
for _, pi := range closerinfos {
9090
log.Debugf("handleGetValue returning closer peer: '%s'", pi.ID)
9191
if len(pi.Addrs) < 1 {
92-
log.Criticalf(`no addresses on peer being sent!
92+
log.Fatalf(`no addresses on peer being sent!
9393
[local:%s]
9494
[sending:%s]
9595
[remote:%s]`, dht.self, pi.ID, p)

routing/supernode/proxy/standard.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (px *standard) Bootstrap(ctx context.Context) error {
5050
cxns = append(cxns, info)
5151
}
5252
if len(cxns) == 0 {
53-
log.Critical("unable to bootstrap to any supernode routers")
53+
log.Fatal("unable to bootstrap to any supernode routers")
5454
} else {
5555
log.Infof("bootstrapped to %d supernode routers: %s", len(cxns), cxns)
5656
}

thirdparty/eventlog/log.go

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
// StandardLogger provides API compatibility with standard printf loggers
1212
// eg. go-logging
1313
type StandardLogger interface {
14-
Critical(args ...interface{})
15-
Criticalf(format string, args ...interface{})
1614
Debug(args ...interface{})
1715
Debugf(format string, args ...interface{})
1816
Error(args ...interface{})

updates/updates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func init() {
9090
var err error
9191
currentVersion, err = parseVersion()
9292
if err != nil {
93-
log.Criticalf("invalid version number in code (must be semver): %q", Version)
93+
log.Fatalf("invalid version number in code (must be semver): %q", Version)
9494
os.Exit(1)
9595
}
9696
log.Infof("go-ipfs Version: %s", currentVersion)

0 commit comments

Comments
 (0)