Adding option to disable jetstream ascii art

This option is not available in the config, and is only accessable to embeded servers where when using custom loggers can look pretty terrible
This commit is contained in:
Tom Anderson
2023-06-21 08:04:34 -07:00
parent aedc38735f
commit 83a43838dc
2 changed files with 14 additions and 8 deletions

View File

@@ -367,13 +367,16 @@ func (s *Server) enableJetStream(cfg JetStreamConfig) error {
s.SetDefaultSystemAccount()
}
s.Noticef(" _ ___ _____ ___ _____ ___ ___ _ __ __")
s.Noticef(" _ | | __|_ _/ __|_ _| _ \\ __| /_\\ | \\/ |")
s.Noticef("| || | _| | | \\__ \\ | | | / _| / _ \\| |\\/| |")
s.Noticef(" \\__/|___| |_| |___/ |_| |_|_\\___/_/ \\_\\_| |_|")
s.Noticef("")
s.Noticef(" https://docs.nats.io/jetstream")
s.Noticef("")
opts := s.getOpts()
if !opts.DisableJetStreamBanner {
s.Noticef(" _ ___ _____ ___ _____ ___ ___ _ __ __")
s.Noticef(" _ | | __|_ _/ __|_ _| _ \\ __| /_\\ | \\/ |")
s.Noticef("| || | _| | | \\__ \\ | | | / _| / _ \\| |\\/| |")
s.Noticef(" \\__/|___| |_| |___/ |_| |_|_\\___/_/ \\_\\_| |_|")
s.Noticef("")
s.Noticef(" https://docs.nats.io/jetstream")
s.Noticef("")
}
s.Noticef("---------------- JETSTREAM ----------------")
s.Noticef(" Max Memory: %s", friendlyBytes(cfg.MaxMemory))
s.Noticef(" Max Storage: %s", friendlyBytes(cfg.MaxStore))
@@ -381,7 +384,7 @@ func (s *Server) enableJetStream(cfg JetStreamConfig) error {
if cfg.Domain != _EMPTY_ {
s.Noticef(" Domain: %s", cfg.Domain)
}
opts := s.getOpts()
if ek := opts.JetStreamKey; ek != _EMPTY_ {
s.Noticef(" Encryption: %s", opts.JetStreamCipher)
}

View File

@@ -347,6 +347,9 @@ type Options struct {
// CheckConfig configuration file syntax test was successful and exit.
CheckConfig bool `json:"-"`
// DisableJetStreamBanner will not print the ascii art on startup for JetStream enabled servers
DisableJetStreamBanner bool `json:"-"`
// ConnectErrorReports specifies the number of failed attempts
// at which point server should report the failure of an initial
// connection to a route, gateway or leaf node.