mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fixing typos, copyright date and changed type in log.go/Error func
added comment and changed type Error(c,sc) Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -3787,7 +3787,7 @@ func (c *client) isClosed() bool {
|
||||
|
||||
// Logging functionality scoped to a client or route.
|
||||
func (c *client) Error(err error) {
|
||||
c.srv.Errorc(c, err)
|
||||
c.srv.Errors(c, err)
|
||||
}
|
||||
|
||||
func (c *client) Errorf(format string, v ...interface{}) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2021 The NATS Authors
|
||||
// Copyright 2020 The NATS Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
@@ -40,7 +40,7 @@ func TestErrCtx(t *testing.T) {
|
||||
t.Fatalf("original error needs to remain")
|
||||
}
|
||||
if !strings.HasSuffix(trace, ctx) {
|
||||
t.Fatalf("ctx nneds to be added")
|
||||
t.Fatalf("ctx needs to be added")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestErrCtxWrapped(t *testing.T) {
|
||||
t.Fatalf("original error needs to remain")
|
||||
}
|
||||
if !strings.HasSuffix(trace, ctx) {
|
||||
t.Fatalf("ctx nneds to be added")
|
||||
t.Fatalf("ctx needs to be added")
|
||||
}
|
||||
if !strings.Contains(trace, ctxO) {
|
||||
t.Fatalf("Needs to contain every context")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2019 The NATS Authors
|
||||
// Copyright 2012-2020 The NATS Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
@@ -163,13 +163,15 @@ func (s *Server) Errors(scope interface{}, e error) {
|
||||
}, "%s - %s", scope, UnpackIfErrorCtx(e))
|
||||
}
|
||||
|
||||
func (s *Server) Errorc(ctx interface{}, e error) {
|
||||
// Error logs an error with a context
|
||||
func (s *Server) Errorc(ctx string, e error) {
|
||||
s.executeLogCall(func(logger Logger, format string, v ...interface{}) {
|
||||
logger.Errorf(format, v...)
|
||||
}, "%s: %s", ctx, UnpackIfErrorCtx(e))
|
||||
}
|
||||
|
||||
func (s *Server) Errorsc(scope interface{}, ctx interface{}, e error) {
|
||||
// Error logs an error with a scope and context
|
||||
func (s *Server) Errorsc(scope interface{}, ctx string, e error) {
|
||||
s.executeLogCall(func(logger Logger, format string, v ...interface{}) {
|
||||
logger.Errorf(format, v...)
|
||||
}, "%s - %s: %s", scope, ctx, UnpackIfErrorCtx(e))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2019 The NATS Authors
|
||||
// Copyright 2012-2020 The NATS Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2019 The NATS Authors
|
||||
// Copyright 2012-2020 The NATS Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
@@ -643,7 +643,7 @@ func (s *Server) reloadOptions(curOpts, newOpts *Options) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Create a ctx that is used to pass special info that we may need
|
||||
// Create a context that is used to pass special info that we may need
|
||||
// while applying the new options.
|
||||
ctx := reloadContext{oldClusterPerms: curOpts.Cluster.Permissions}
|
||||
s.setOpts(newOpts)
|
||||
|
||||
Reference in New Issue
Block a user