mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-10-19 13:49:53 +00:00
9b6795c6d6
Bumps [github.com/hashicorp/vault](https://github.com/hashicorp/vault) from 1.9.9 to 1.11.9. - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v1.9.9...v1.11.9) --- updated-dependencies: - dependency-name: github.com/hashicorp/vault dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
39 lines
881 B
Go
39 lines
881 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package hclog
|
|
|
|
import (
|
|
"os"
|
|
|
|
colorable "github.com/mattn/go-colorable"
|
|
"github.com/mattn/go-isatty"
|
|
)
|
|
|
|
// setColorization will mutate the values of this logger
|
|
// to appropriately configure colorization options. It provides
|
|
// a wrapper to the output stream on Windows systems.
|
|
func (l *intLogger) setColorization(opts *LoggerOptions) {
|
|
switch opts.Color {
|
|
case ColorOff:
|
|
return
|
|
case ForceColor:
|
|
fi := l.checkWriterIsFile()
|
|
l.writer.w = colorable.NewColorable(fi)
|
|
case AutoColor:
|
|
fi := l.checkWriterIsFile()
|
|
isUnixTerm := isatty.IsTerminal(os.Stdout.Fd())
|
|
isCygwinTerm := isatty.IsCygwinTerminal(os.Stdout.Fd())
|
|
isTerm := isUnixTerm || isCygwinTerm
|
|
if !isTerm {
|
|
l.writer.color = ColorOff
|
|
l.headerColor = ColorOff
|
|
return
|
|
}
|
|
|
|
if l.headerColor == ColorOff {
|
|
l.writer.w = colorable.NewColorable(fi)
|
|
}
|
|
}
|
|
}
|