mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
Switch output loggers in hclog instead of going through gatedlogger (#8228)
After flushing we no longer have to take a mutex hit for every log line.
This commit is contained in:
@@ -223,9 +223,9 @@ func (c *DebugCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// Initialize the logger for debug output
|
||||
logWriter := gatedwriter.NewWriter(os.Stderr)
|
||||
gatedWriter := gatedwriter.NewWriter(os.Stderr)
|
||||
if c.logger == nil {
|
||||
c.logger = logging.NewVaultLoggerWithWriter(logWriter, hclog.Trace)
|
||||
c.logger = logging.NewVaultLoggerWithWriter(gatedWriter, hclog.Trace)
|
||||
}
|
||||
|
||||
dstOutputFile, err := c.preflight(args)
|
||||
@@ -246,7 +246,9 @@ func (c *DebugCommand) Run(args []string) int {
|
||||
c.UI.Output("")
|
||||
|
||||
// Release the log gate.
|
||||
logWriter.Flush()
|
||||
c.logger.(hclog.OutputResettable).ResetOutputWithFlush(&hclog.LoggerOptions{
|
||||
Output: os.Stderr,
|
||||
}, gatedWriter)
|
||||
|
||||
// Capture static information
|
||||
c.UI.Info("==> Capturing static information...")
|
||||
|
||||
Reference in New Issue
Block a user