diff options
| author | Shulhan <ms@kilabit.info> | 2023-11-23 11:02:05 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-11-25 01:33:07 +0700 |
| commit | a9701f66c2e38a3a7f3d12deed6ebba5144e208e (patch) | |
| tree | 0f4300ba3d35b353b1b0f629a406aa00d563d4fa /http_server.go | |
| parent | d507104c77d6d8bd6b00cc610e8710d326ecd11e (diff) | |
| download | awwan-a9701f66c2e38a3a7f3d12deed6ebba5144e208e.tar.xz | |
all: print non error information using package log instead of fmt
Although log print to stderr, this allow user to filter between awwan
output and command output, for example by piping stderr to /dev/null
$ awwan env-get "key" dir/ 2>/dev/null
The output env-get is not poluted by other logs.
Diffstat (limited to 'http_server.go')
| -rw-r--r-- | http_server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/http_server.go b/http_server.go index 009b821..04ac90a 100644 --- a/http_server.go +++ b/http_server.go @@ -9,6 +9,7 @@ import ( "errors" "fmt" "io/fs" + "log" "net/http" "os" "path" @@ -178,7 +179,7 @@ func (httpd *httpServer) registerEndpoints() (err error) { // start the HTTP server. func (httpd *httpServer) start() (err error) { - fmt.Printf("--- Starting HTTP server at http://%s\n", httpd.Server.Options.Address) + log.Printf(`--- Starting HTTP server at http://%s`, httpd.Server.Options.Address) return httpd.Server.Start() } |
