mirror of
				https://codeberg.org/cunicu/cunicu.git
				synced 2025-10-31 16:36:21 +08:00 
			
		
		
		
	add --log-file command line argument
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
		| @@ -15,10 +15,10 @@ var ( | ||||
| 	outputDir string | ||||
|  | ||||
| 	docsCmd = &cobra.Command{ | ||||
| 		Use:   "docs", | ||||
| 		Short: "Generate documentation for the wice commands", | ||||
| 		// Hidden: true, | ||||
| 		Args: cobra.NoArgs, | ||||
| 		Use:    "docs", | ||||
| 		Short:  "Generate documentation for the wice commands", | ||||
| 		Hidden: true, | ||||
| 		Args:   cobra.NoArgs, | ||||
| 		RunE: func(cmd *cobra.Command, args []string) error { | ||||
| 			if err := docsMarkdown(cmd, args); err != nil { | ||||
| 				return err | ||||
|   | ||||
| @@ -46,37 +46,40 @@ var ( | ||||
| 		Long:  "Wireguard Interactive Connectitivty Establishment", | ||||
|  | ||||
| 		// The main wice command is just an alias for "wice daemon" | ||||
| 		Run: daemon, | ||||
| 		Run:               daemon, | ||||
| 		DisableAutoGenTag: true, | ||||
| 		Version:           version, | ||||
| 	} | ||||
|  | ||||
| 	version string //lint:ignore U1000 set via ldflags -X / goreleaser | ||||
| 	commit  string //lint:ignore U1000 set via ldflags -X / goreleaser | ||||
| 	date    string //lint:ignore U1000 set via ldflags -X / goreleaser | ||||
|  | ||||
| 	level = logLevel{zapcore.InfoLevel} | ||||
| 	logLevel = level{zapcore.InfoLevel} | ||||
| 	logFile  string | ||||
| ) | ||||
|  | ||||
| type logLevel struct { | ||||
| type level struct { | ||||
| 	zapcore.Level | ||||
| } | ||||
|  | ||||
| func (l *logLevel) Type() string { | ||||
| func (l *level) Type() string { | ||||
| 	return "string" | ||||
| } | ||||
|  | ||||
| func init() { | ||||
| 	rootCmd.SetUsageTemplate(usageTemplate) | ||||
|  | ||||
| 	cobra.OnInitialize( | ||||
| 		internal.SetupRand, | ||||
| 		setupLogging, | ||||
| 	) | ||||
|  | ||||
| 	rootCmd.Version = version | ||||
| 	rootCmd.SetUsageTemplate(usageTemplate) | ||||
|  | ||||
| 	pf := rootCmd.PersistentFlags() | ||||
| 	pf.VarP(&level, "log-level", "d", "log level (one of \"debug\", \"info\", \"warn\", \"error\", \"dpanic\", \"panic\", and \"fatal\")") | ||||
| 	pf.VarP(&logLevel, "log-level", "d", "log level (one of \"debug\", \"info\", \"warn\", \"error\", \"dpanic\", \"panic\", and \"fatal\")") | ||||
| 	pf.StringVarP(&logFile, "log-file", "l", "", "path of a file to write logs to") | ||||
| } | ||||
|  | ||||
| func setupLogging() { | ||||
| 	logger = internal.SetupLogging(level.Level) | ||||
| 	logger = internal.SetupLogging(logLevel.Level, logFile) | ||||
| } | ||||
|   | ||||
| @@ -23,7 +23,7 @@ var ( | ||||
|  | ||||
| func init() { | ||||
| 	pf := signalCmd.PersistentFlags() | ||||
| 	pf.StringVarP(&listenAddress, "listen", "l", ":443", "listen address") | ||||
| 	pf.StringVarP(&listenAddress, "listen", "L", ":443", "listen address") | ||||
|  | ||||
| 	rootCmd.AddCommand(signalCmd) | ||||
| } | ||||
|   | ||||
| @@ -69,6 +69,10 @@ You will need to start a new shell for this setup to take effect. | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -54,6 +54,10 @@ You will need to start a new shell for this setup to take effect. | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -43,6 +43,10 @@ to your powershell profile. | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -66,6 +66,10 @@ You will need to start a new shell for this setup to take effect. | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -24,6 +24,10 @@ See each sub-command's help for details on how to use the generated script. | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -62,7 +62,7 @@ Start the daemon | ||||
| 	interval netween STUN keepalives | ||||
|  | ||||
| .PP | ||||
| \fB-l\fP, \fB--ice-lite\fP[=false] | ||||
| \fB-L\fP, \fB--ice-lite\fP[=false] | ||||
| 	lite agents do not perform connectivity check and only provide host candidates | ||||
|  | ||||
| .PP | ||||
| @@ -139,6 +139,10 @@ Start the daemon | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -27,6 +27,10 @@ Monitor the WICE daemon for events | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -22,11 +22,15 @@ Start gRPC signaling server | ||||
| 	help for signal | ||||
|  | ||||
| .PP | ||||
| \fB-l\fP, \fB--listen\fP=":443" | ||||
| \fB-L\fP, \fB--listen\fP=":443" | ||||
| 	listen address | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -27,6 +27,10 @@ Shutdown the WICE daemon | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -27,6 +27,10 @@ Synchronizes the internal daemon state with the state of the Wireguard interface | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -23,6 +23,10 @@ Generates a new private key and writes it to stdout | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -23,6 +23,10 @@ Generates a new preshared key and writes it to stdout | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -23,6 +23,10 @@ Reads a private key from stdin and writes a public key to stdout | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -27,6 +27,10 @@ Shows the current configuration and device information | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -23,6 +23,10 @@ Wireguard commands | ||||
|  | ||||
|  | ||||
| .SH OPTIONS INHERITED FROM PARENT COMMANDS | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
|   | ||||
| @@ -21,6 +21,10 @@ Wireguard Interactive Connectitivty Establishment | ||||
| \fB-h\fP, \fB--help\fP[=false] | ||||
| 	help for wice | ||||
|  | ||||
| .PP | ||||
| \fB-l\fP, \fB--log-file\fP="" | ||||
| 	path of a file to write logs to | ||||
|  | ||||
| .PP | ||||
| \fB-d\fP, \fB--log-level\fP="info" | ||||
| 	log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") | ||||
| @@ -28,4 +32,4 @@ Wireguard Interactive Connectitivty Establishment | ||||
|  | ||||
| .SH SEE ALSO | ||||
| .PP | ||||
| \fBwice-completion(3)\fP, \fBwice-daemon(3)\fP, \fBwice-monitor(3)\fP, \fBwice-signal(3)\fP, \fBwice-stop(3)\fP, \fBwice-sync(3)\fP, \fBwice-wg(3)\fP | ||||
| \fBwice-completion(3)\fP, \fBwice-daemon(3)\fP, \fBwice-interface(3)\fP, \fBwice-monitor(3)\fP, \fBwice-peer(3)\fP, \fBwice-signal(3)\fP, \fBwice-stop(3)\fP, \fBwice-sync(3)\fP, \fBwice-wg(3)\fP | ||||
|   | ||||
| @@ -14,6 +14,7 @@ wice [flags] | ||||
|  | ||||
| ``` | ||||
|   -h, --help               help for wice | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
| @@ -21,7 +22,9 @@ wice [flags] | ||||
|  | ||||
| * [wice completion](wice_completion.md)	 - Generate the autocompletion script for the specified shell | ||||
| * [wice daemon](wice_daemon.md)	 - Start the daemon | ||||
| * [wice interface](wice_interface.md)	 - Manage Wireguard interfaces | ||||
| * [wice monitor](wice_monitor.md)	 - Monitor the WICE daemon for events | ||||
| * [wice peer](wice_peer.md)	 - Manage Wireguard peers | ||||
| * [wice signal](wice_signal.md)	 - Start gRPC signaling server | ||||
| * [wice stop](wice_stop.md)	 - Shutdown the WICE daemon | ||||
| * [wice sync](wice_sync.md)	 - Synchronize interfaces | ||||
|   | ||||
| @@ -17,6 +17,7 @@ See each sub-command's help for details on how to use the generated script. | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -40,6 +40,7 @@ wice completion bash | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -31,6 +31,7 @@ wice completion fish [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -28,6 +28,7 @@ wice completion powershell [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -38,6 +38,7 @@ wice completion zsh [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -20,7 +20,7 @@ wice daemon [interfaces...] [flags] | ||||
|   -k, --ice-insecure-skip-verify           skip verification of TLS certificates for secure STUN/TURN servers | ||||
|       --ice-interface-filter string        regex for filtering local interfaces for ICE candidate gathering (e.g. "eth[0-9]+") (default ".*") | ||||
|       --ice-keepalive-interval duration    interval netween STUN keepalives (default 2s) | ||||
|   -l, --ice-lite                           lite agents do not perform connectivity check and only provide host candidates | ||||
|   -L, --ice-lite                           lite agents do not perform connectivity check and only provide host candidates | ||||
|       --ice-max-binding-requests uint16    maximum number of binding request before considering a pair failed (default 7) | ||||
|   -m, --ice-mdns                           enable local Multicast DNS discovery | ||||
|       --ice-nat-1to1-ip ipSlice            IP addresses which will be added as local server reflexive candidates (default []) | ||||
| @@ -44,6 +44,7 @@ wice daemon [interfaces...] [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -16,6 +16,7 @@ wice monitor [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -10,12 +10,13 @@ wice signal [flags] | ||||
|  | ||||
| ``` | ||||
|   -h, --help            help for signal | ||||
|   -l, --listen string   listen address (default ":443") | ||||
|   -L, --listen string   listen address (default ":443") | ||||
| ``` | ||||
|  | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -16,6 +16,7 @@ wice stop [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -20,6 +20,7 @@ wice sync [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -11,6 +11,7 @@ Wireguard commands | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -15,6 +15,7 @@ wice wg genkey [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -15,6 +15,7 @@ wice wg genpsk [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -15,6 +15,7 @@ wice wg pubkey [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -16,6 +16,7 @@ wice wg show [flags] | ||||
| ### Options inherited from parent commands | ||||
|  | ||||
| ``` | ||||
|   -l, --log-file string    path of a file to write logs to | ||||
|   -d, --log-level string   log level (one of "debug", "info", "warn", "error", "dpanic", "panic", and "fatal") (default "info") | ||||
| ``` | ||||
|  | ||||
|   | ||||
| @@ -19,7 +19,7 @@ import ( | ||||
| 	"riasc.eu/wice/internal/log" | ||||
| ) | ||||
|  | ||||
| func SetupLogging(level zapcore.Level) *zap.Logger { | ||||
| func SetupLogging(level zapcore.Level, file string) *zap.Logger { | ||||
| 	cfg := zap.NewDevelopmentConfig() | ||||
|  | ||||
| 	cfg.Level = zap.NewAtomicLevelAt(level) | ||||
| @@ -27,6 +27,10 @@ func SetupLogging(level zapcore.Level) *zap.Logger { | ||||
| 	cfg.DisableCaller = true | ||||
| 	cfg.DisableStacktrace = true | ||||
|  | ||||
| 	if file != "" { | ||||
| 		cfg.OutputPaths = append(cfg.OutputPaths, file) | ||||
| 	} | ||||
|  | ||||
| 	logger, err := cfg.Build() | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| @@ -43,6 +47,7 @@ func SetupLogging(level zapcore.Level) *zap.Logger { | ||||
| 	glogger := logger.Named("grpc") | ||||
| 	grpclog.SetLoggerV2(log.NewGRPCLogger(glogger)) | ||||
|  | ||||
| 	zap.RedirectStdLog(logger) | ||||
| 	zap.ReplaceGlobals(logger) | ||||
|  | ||||
| 	return logger | ||||
|   | ||||
| @@ -153,7 +153,7 @@ func NewConfig(flags *pflag.FlagSet) *Config { | ||||
|  | ||||
| 	flags.Uint16Var(&cfg.icePortMin, "ice-port-min", 0, "minimum port for allocation policy (range: 0-65535)") | ||||
| 	flags.Uint16Var(&cfg.icePortMax, "ice-port-max", 0, "maximum port for allocation policy (range: 0-65535)") | ||||
| 	flags.BoolVarP(&cfg.iceLite, "ice-lite", "l", false, "lite agents do not perform connectivity check and only provide host candidates") | ||||
| 	flags.BoolVarP(&cfg.iceLite, "ice-lite", "L", false, "lite agents do not perform connectivity check and only provide host candidates") | ||||
| 	flags.BoolVarP(&cfg.iceMdns, "ice-mdns", "m", false, "enable local Multicast DNS discovery") | ||||
| 	flags.Uint16Var(&cfg.iceMaxBindingRequests, "ice-max-binding-requests", defaultMaxBindingRequests, "maximum number of binding request before considering a pair failed") | ||||
| 	flags.BoolVarP(&cfg.iceInsecureSkipVerify, "ice-insecure-skip-verify", "k", false, "skip verification of TLS certificates for secure STUN/TURN servers") | ||||
|   | ||||
| @@ -7,7 +7,6 @@ import ( | ||||
| 	"strings" | ||||
|  | ||||
| 	"github.com/pion/ice/v2" | ||||
| 	"go.uber.org/zap" | ||||
| 	"riasc.eu/wice/pkg/proxy" | ||||
| ) | ||||
|  | ||||
| @@ -144,16 +143,6 @@ func (pt *proxyType) Set(value string) error { | ||||
| 	return err | ||||
| } | ||||
|  | ||||
| type logLevel struct{ zap.AtomicLevel } | ||||
|  | ||||
| func (ll *logLevel) Type() string { | ||||
| 	return "string" | ||||
| } | ||||
|  | ||||
| func (ll *logLevel) Set(value string) error { | ||||
| 	return ll.UnmarshalText([]byte(value)) | ||||
| } | ||||
|  | ||||
| type regex struct{ *regexp.Regexp } | ||||
|  | ||||
| func (re *regex) Type() string { | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import ( | ||||
|  | ||||
| func Main(m *testing.M) { | ||||
| 	internal.SetupRand() | ||||
| 	logger := internal.SetupLogging(zapcore.DebugLevel) | ||||
| 	logger := internal.SetupLogging(zapcore.DebugLevel, "logs/test.log") | ||||
| 	defer logger.Sync() | ||||
|  | ||||
| 	os.Exit(m.Run()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Steffen Vogel
					Steffen Vogel