Add silent flag to reduce output

This commit is contained in:
Wayback Archiver 2023-05-20 11:32:55 +01:00
parent 6fcd53d2a0
commit ef84901bc2
No known key found for this signature in database
GPG key ID: 57D14486138C9377
4 changed files with 15 additions and 5 deletions

View file

@ -53,7 +53,7 @@ func createIPCRequest(conf *DeviceConfig) (*DeviceSetting, error) {
}
// StartWireguard creates a tun interface on netstack given a configuration
func StartWireguard(conf *DeviceConfig) (*VirtualTun, error) {
func StartWireguard(conf *DeviceConfig, logLevel int) (*VirtualTun, error) {
setting, err := createIPCRequest(conf)
if err != nil {
return nil, err
@ -63,7 +63,7 @@ func StartWireguard(conf *DeviceConfig) (*VirtualTun, error) {
if err != nil {
return nil, err
}
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(device.LogLevelVerbose, ""))
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(logLevel, ""))
err = dev.IpcSet(setting.ipcRequest)
if err != nil {
return nil, err