Accept log level flag even when started in shadowsocks mode.

This commit is contained in:
notsure2 2020-03-28 23:10:45 +02:00 committed by Andy Wang
parent e2c234fb76
commit d4ac2a2cf5
1 changed files with 9 additions and 0 deletions

View File

@ -241,6 +241,15 @@ func main() {
remoteHost = os.Getenv("SS_REMOTE_HOST")
remotePort = os.Getenv("SS_REMOTE_PORT")
config = os.Getenv("SS_PLUGIN_OPTIONS")
verbosity := flag.String("verbosity", "debug", "verbosity level")
flag.Parse()
lvl, err := log.ParseLevel(*verbosity)
if err != nil {
log.Fatal(err)
}
log.SetLevel(lvl)
} else {
flag.StringVar(&localHost, "i", "127.0.0.1", "localHost: Cloak listens to proxy clients on this ip")
flag.StringVar(&localPort, "l", "1984", "localPort: Cloak listens to proxy clients on this port")