mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2025-01-12 11:51:44 +00:00
additional logging of errors for debugging purposes
This commit is contained in:
parent
4778d287fc
commit
d9df5cad1e
@ -5,6 +5,7 @@ package proxy
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@ -33,9 +34,11 @@ func Debug(cfgPath string) {
|
|||||||
fmt.Printf("\nConfig:\n")
|
fmt.Printf("\nConfig:\n")
|
||||||
fmt.Printf("%s\n\n", path)
|
fmt.Printf("%s\n\n", path)
|
||||||
|
|
||||||
proxy, _ := ReadSystemProxy()
|
proxy, err := ReadSystemProxy()
|
||||||
proxyServer := proxy.Server
|
proxyServer := proxy.Server
|
||||||
if proxyServer == "" {
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
} else if proxyServer == "" {
|
||||||
proxyServer = "[N/A]"
|
proxyServer = "[N/A]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +46,11 @@ func Debug(cfgPath string) {
|
|||||||
fmt.Printf("Enabled: %t\n", proxy.Enabled)
|
fmt.Printf("Enabled: %t\n", proxy.Enabled)
|
||||||
fmt.Printf("Server: %s\n\n", proxyServer)
|
fmt.Printf("Server: %s\n\n", proxyServer)
|
||||||
|
|
||||||
configs, _ := util.ReadConfigs(cfgPath)
|
configs, err := util.ReadConfigs(cfgPath)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
for _, config := range configs {
|
for _, config := range configs {
|
||||||
configCmd := config.Name
|
configCmd := config.Name
|
||||||
// Use command instead of name, if given
|
// Use command instead of name, if given
|
||||||
|
Loading…
Reference in New Issue
Block a user