mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2018 The NATS Authors
|
||||
// Copyright 2012-2019 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
|
||||
@@ -11,7 +11,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//Package logger provides logging facilities for the NATS server
|
||||
// Package logger provides logging facilities for the NATS server
|
||||
package logger
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2018 The NATS Authors
|
||||
// Copyright 2012-2019 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
|
||||
@@ -37,7 +37,7 @@ func SetSyslogName(name string) {}
|
||||
|
||||
// GetSysLoggerTag generates the tag name for use in syslog statements. If
|
||||
// the executable is linked, the name of the link will be used as the tag,
|
||||
// otherwise, the name of the executable is used. "gnatsd" is the default
|
||||
// otherwise, the name of the executable is used. "nats-server" is the default
|
||||
// for the NATS server.
|
||||
func GetSysLoggerTag() string {
|
||||
procName := os.Args[0]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2012-2018 The NATS Authors
|
||||
// Copyright 2012-2019 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
|
||||
@@ -67,14 +67,14 @@ func TestSysLoggerTagGen(t *testing.T) {
|
||||
origArg := os.Args[0]
|
||||
defer restoreArg(origArg)
|
||||
|
||||
testTag(t, "gnatsd", "gnatsd")
|
||||
testTag(t, filepath.Join(".", "gnatsd"), "gnatsd")
|
||||
testTag(t, filepath.Join("home", "bin", "gnatsd"), "gnatsd")
|
||||
testTag(t, filepath.Join("..", "..", "gnatsd"), "gnatsd")
|
||||
testTag(t, "gnatsd.service1", "gnatsd.service1")
|
||||
testTag(t, "gnatsd_service1", "gnatsd_service1")
|
||||
testTag(t, "gnatsd-service1", "gnatsd-service1")
|
||||
testTag(t, "gnatsd service1", "gnatsd service1")
|
||||
testTag(t, "nats-server", "nats-server")
|
||||
testTag(t, filepath.Join(".", "nats-server"), "nats-server")
|
||||
testTag(t, filepath.Join("home", "bin", "nats-server"), "nats-server")
|
||||
testTag(t, filepath.Join("..", "..", "nats-server"), "nats-server")
|
||||
testTag(t, "nats-server.service1", "nats-server.service1")
|
||||
testTag(t, "nats-server_service1", "nats-server_service1")
|
||||
testTag(t, "nats-server-service1", "nats-server-service1")
|
||||
testTag(t, "nats-server service1", "nats-server service1")
|
||||
}
|
||||
|
||||
func TestSysLoggerTag(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user