mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-07-22 19:08:01 +00:00
feat: add a hysteria prefix to env vars to avoid conflicts
This commit is contained in:
@@ -19,6 +19,9 @@ const (
|
|||||||
`
|
`
|
||||||
appDesc = "a powerful, censorship-resistant proxy tool optimized for lossy networks"
|
appDesc = "a powerful, censorship-resistant proxy tool optimized for lossy networks"
|
||||||
appAuthors = "Aperture Internet Laboratory <https://github.com/apernet>"
|
appAuthors = "Aperture Internet Laboratory <https://github.com/apernet>"
|
||||||
|
|
||||||
|
appLogLevelEnv = "HYSTERIA_LOG_LEVEL"
|
||||||
|
appLogFormatEnv = "HYSTERIA_LOG_FORMAT"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -93,8 +96,8 @@ func init() {
|
|||||||
|
|
||||||
func initFlags() {
|
func initFlags() {
|
||||||
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file")
|
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file")
|
||||||
rootCmd.PersistentFlags().StringVarP(&logLevel, "log-level", "l", envOrDefault("LOG_LEVEL", "info"), "log level")
|
rootCmd.PersistentFlags().StringVarP(&logLevel, "log-level", "l", envOrDefault(appLogLevelEnv, "info"), "log level")
|
||||||
rootCmd.PersistentFlags().StringVarP(&logFormat, "log-format", "f", envOrDefault("LOG_FORMAT", "console"), "log format")
|
rootCmd.PersistentFlags().StringVarP(&logFormat, "log-format", "f", envOrDefault(appLogFormatEnv, "console"), "log format")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initConfig() {
|
func initConfig() {
|
||||||
|
Reference in New Issue
Block a user