mirror of
https://github.com/safing/portmaster
synced 2025-09-04 11:39:29 +00:00
Disable Windows debug output for show
This commit is contained in:
parent
4a18f9b96f
commit
b671a68aec
1 changed files with 8 additions and 3 deletions
|
@ -6,7 +6,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ func init() {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// set meta info
|
// set meta info
|
||||||
info.Set("Portmaster Control", "0.2.9", "AGPLv3", true)
|
info.Set("Portmaster Control", "0.2.10", "AGPLv3", true)
|
||||||
|
|
||||||
// for debugging
|
// for debugging
|
||||||
// log.Start()
|
// log.Start()
|
||||||
|
@ -131,6 +130,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||||
// not using portbase logger
|
// not using portbase logger
|
||||||
portlog.SetLogLevel(portlog.CriticalLevel)
|
portlog.SetLogLevel(portlog.CriticalLevel)
|
||||||
|
|
||||||
|
// data directory
|
||||||
if !showShortVersion && !showFullVersion {
|
if !showShortVersion && !showFullVersion {
|
||||||
// set data root
|
// set data root
|
||||||
// backwards compatibility
|
// backwards compatibility
|
||||||
|
@ -141,6 +141,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||||
if dataDir == "" {
|
if dataDir == "" {
|
||||||
return errors.New("please set the data directory using --data=/path/to/data/dir")
|
return errors.New("please set the data directory using --data=/path/to/data/dir")
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove redundant escape characters and quotes
|
// remove redundant escape characters and quotes
|
||||||
dataDir = strings.Trim(dataDir, `\"`)
|
dataDir = strings.Trim(dataDir, `\"`)
|
||||||
// initialize structure
|
// initialize structure
|
||||||
|
@ -151,6 +152,10 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||||
dataRoot = structure.Root()
|
dataRoot = structure.Root()
|
||||||
// manually set updates root (no modules)
|
// manually set updates root (no modules)
|
||||||
updates.SetDataRoot(structure.Root())
|
updates.SetDataRoot(structure.Root())
|
||||||
|
}
|
||||||
|
|
||||||
|
// logs and warning
|
||||||
|
if !showShortVersion && !showFullVersion && !strings.Contains(cmd.CommandPath(), " show ") {
|
||||||
// set up logs root
|
// set up logs root
|
||||||
logsRoot = structure.NewRootDir("logs", 0777)
|
logsRoot = structure.NewRootDir("logs", 0777)
|
||||||
err = logsRoot.Ensure()
|
err = logsRoot.Ensure()
|
||||||
|
@ -159,7 +164,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// warn about CTRL-C on windows
|
// warn about CTRL-C on windows
|
||||||
if runningInConsole && runtime.GOOS == "windows" {
|
if runningInConsole && onWindows {
|
||||||
log.Println("WARNING: portmaster-control is marked as a GUI application in order to get rid of the console window.")
|
log.Println("WARNING: portmaster-control is marked as a GUI application in order to get rid of the console window.")
|
||||||
log.Println("WARNING: CTRL-C will immediately kill without clean shutdown.")
|
log.Println("WARNING: CTRL-C will immediately kill without clean shutdown.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue