From a51b997a6e5f5212ebd0afbeaf9698385daaef7f Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Mon, 22 Jul 2024 13:56:32 +0300 Subject: [PATCH] Pull request 60: 3 darwin syslog Updates #3. Squashed commit of the following: commit d7f07aff8e10729aac1c4c8a09199afee9f715a0 Author: Eugene Burkov Date: Thu Jul 18 14:48:34 2024 +0300 agdcslog: imp code commit 4c4abd7d0dc54f57242c6c0c8d89b3578b30f7dd Author: Eugene Burkov Date: Wed Jul 17 19:45:27 2024 +0300 agdcslog: fix panic commit 3b2c62ab87a86a914e5fb736ca6e7b6375e91564 Author: Eugene Burkov Date: Wed Jul 17 19:34:37 2024 +0300 agdcslog: imp code, docs commit 39a9e61fc20e9576f15117b690e3487ad2ffa426 Author: Eugene Burkov Date: Wed Jul 17 17:48:34 2024 +0300 all: implement piped logger on darwin --- CHANGELOG.md | 4 + internal/agdcslog/agdcslog.go | 49 ++-- internal/agdcslog/agdcslog_test.go | 41 ++- internal/agdcslog/syslog.go | 29 ++ internal/agdcslog/syslog_darwin.go | 257 ++++++++++++++++++ .../{agdcslog_unix.go => syslog_linux.go} | 20 +- ...{agdcslog_windows.go => syslog_windows.go} | 19 +- internal/cmd/log.go | 2 +- 8 files changed, 348 insertions(+), 73 deletions(-) create mode 100644 internal/agdcslog/syslog.go create mode 100644 internal/agdcslog/syslog_darwin.go rename internal/agdcslog/{agdcslog_unix.go => syslog_linux.go} (56%) rename internal/agdcslog/{agdcslog_windows.go => syslog_windows.go} (76%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 682fae8..f7e0485 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,12 +30,16 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Fixed +- The `syslog` log output on macOS ([#3]). + + **NOTE:** The implementation is actually a workaround for a known [Go issue][go-59229], and uses the `/usr/bin/logger` utility. This approach is suboptimal and will be improved once the Go issue is resolved. - DNS proxy logs being written to `stderr` instead of `log.output` ([#1]). [#1]: https://github.com/AdguardTeam/AdGuardDNSClient/issues/1 [#2]: https://github.com/AdguardTeam/AdGuardDNSClient/issues/2 [go-1.22.5]: https://groups.google.com/g/golang-announce/c/gyb7aM1C9H4 +[go-59229]: https://github.com/golang/go/issues/59229