From 05db1b710935d0b5e1b09f52b2cf2ed88b40f810 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 25 Jan 2022 22:11:15 +0000 Subject: [PATCH] Formatting and improving logs for config loading --- cmd/headscale/headscale.go | 2 +- cmd/headscale/headscale_test.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/headscale/headscale.go b/cmd/headscale/headscale.go index d6bf2166..600b186e 100644 --- a/cmd/headscale/headscale.go +++ b/cmd/headscale/headscale.go @@ -44,7 +44,7 @@ func main() { }) if err := cli.LoadConfig(""); err != nil { - log.Fatal().Err(err) + log.Fatal().Caller().Err(err) } machineOutput := cli.HasMachineOutputFlag() diff --git a/cmd/headscale/headscale_test.go b/cmd/headscale/headscale_test.go index 218e458e..5ab46e00 100644 --- a/cmd/headscale/headscale_test.go +++ b/cmd/headscale/headscale_test.go @@ -61,7 +61,11 @@ func (*Suite) TestConfigLoading(c *check.C) { c.Assert(viper.GetString("tls_letsencrypt_listen"), check.Equals, ":http") c.Assert(viper.GetString("tls_letsencrypt_challenge_type"), check.Equals, "HTTP-01") c.Assert(viper.GetStringSlice("dns_config.nameservers")[0], check.Equals, "1.1.1.1") - c.Assert(cli.GetFileMode("unix_socket_permission"), check.Equals, fs.FileMode(0o770)) + c.Assert( + cli.GetFileMode("unix_socket_permission"), + check.Equals, + fs.FileMode(0o770), + ) } func (*Suite) TestDNSConfigLoading(c *check.C) {