From 983214f253ddc27262ca30dc408485ba9389d95e Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Fri, 24 May 2024 16:40:47 -0600 Subject: [PATCH 1/2] Simplify `wwctl server` - Always run in the foreground - Always log to stdout/err (unless syslog is requested) - Update systemd to reload with a direct signal - Omit any pidfile for "warewulfd" Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 3 ++ docs/man/man5/warewulf.conf.5 | 6 +--- include/systemd/warewulfd.service.in | 10 ++----- internal/app/wwctl/server/reload/main.go | 11 ------- internal/app/wwctl/server/reload/root.go | 20 ------------- internal/app/wwctl/server/restart/main.go | 15 ---------- internal/app/wwctl/server/restart/root.go | 20 ------------- internal/app/wwctl/server/root.go | 30 ++++++++----------- internal/app/wwctl/server/start/main.go | 19 ------------ internal/app/wwctl/server/start/root.go | 22 -------------- internal/app/wwctl/server/status/main.go | 10 ------- internal/app/wwctl/server/status/root.go | 17 ----------- internal/app/wwctl/server/stop/main.go | 11 ------- internal/app/wwctl/server/stop/root.go | 17 ----------- internal/pkg/warewulfd/daemon.go | 30 ++++--------------- internal/pkg/warewulfd/warewulfd.go | 18 +---------- userdocs/contents/configuration.rst | 3 +- userdocs/contents/initialization.rst | 19 ------------ .../development-environment-kvm.rst | 4 +-- .../development-environment-vagrant.rst | 2 +- .../development-environment-vbox.rst | 4 +-- 21 files changed, 30 insertions(+), 261 deletions(-) delete mode 100644 internal/app/wwctl/server/reload/main.go delete mode 100644 internal/app/wwctl/server/reload/root.go delete mode 100644 internal/app/wwctl/server/restart/main.go delete mode 100644 internal/app/wwctl/server/restart/root.go delete mode 100644 internal/app/wwctl/server/start/main.go delete mode 100644 internal/app/wwctl/server/start/root.go delete mode 100644 internal/app/wwctl/server/status/main.go delete mode 100644 internal/app/wwctl/server/status/root.go delete mode 100644 internal/app/wwctl/server/stop/main.go delete mode 100644 internal/app/wwctl/server/stop/root.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 28acade70..79f4eb1b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,12 +44,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Switched from yaml.v2 to yaml.v3 #1462 - Make OCIBlobCache a seperate path and point it to `/var/cache` #1459 - Updated various shell scripts for POSIX compatibility. #1464 +- Update `wwctl server` to always run in the foreground #508 +- Update `wwctl server` to log to stdout rather than a file #503 ### Removed - `wwctl node list --fullall` has been removed - `wwctl profile list --fullall` has been removed +- Remove `wwctl server ` #508 ### Fixed diff --git a/docs/man/man5/warewulf.conf.5 b/docs/man/man5/warewulf.conf.5 index 9c2228580..3b21ec9e3 100644 --- a/docs/man/man5/warewulf.conf.5 +++ b/docs/man/man5/warewulf.conf.5 @@ -112,11 +112,7 @@ Default: true .TP \fBsyslog\fP -When true, Warewulf server logs are written to syslog, rather than a -local file. - -When false, Warewulf server logs are written to -`/var/log/warewulfd.log'. +When true, Warewulf server logs are written to syslog. Default: false .IP diff --git a/include/systemd/warewulfd.service.in b/include/systemd/warewulfd.service.in index 7ba04a7aa..6ba38606e 100644 --- a/include/systemd/warewulfd.service.in +++ b/include/systemd/warewulfd.service.in @@ -5,15 +5,11 @@ After=network-online.target AssertFileIsExecutable=@BINDIR@/wwctl [Service] -Type=simple +Type=exec User=root Group=root - -ExecStart=@BINDIR@/wwctl server start -ExecReload=@BINDIR@/wwctl server reload -ExecStop=@BINDIR@/wwctl server stop - -PIDFile=/var/run/warewulfd.pid +ExecStart=@BINDIR@/wwctl server +ExecReload=/bin/kill -HUP "$MAINPID" Restart=always [Install] diff --git a/internal/app/wwctl/server/reload/main.go b/internal/app/wwctl/server/reload/main.go deleted file mode 100644 index ad285cc1f..000000000 --- a/internal/app/wwctl/server/reload/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package reload - -import ( - "github.com/pkg/errors" - "github.com/spf13/cobra" - "github.com/warewulf/warewulf/internal/pkg/warewulfd" -) - -func CobraRunE(cmd *cobra.Command, args []string) error { - return errors.Wrap(warewulfd.DaemonReload(), "failed to reload Warewulf server") -} diff --git a/internal/app/wwctl/server/reload/root.go b/internal/app/wwctl/server/reload/root.go deleted file mode 100644 index b8b6d4c2f..000000000 --- a/internal/app/wwctl/server/reload/root.go +++ /dev/null @@ -1,20 +0,0 @@ -package reload - -import "github.com/spf13/cobra" - -var ( - baseCmd = &cobra.Command{ - DisableFlagsInUseLine: true, - Use: "reload [OPTIONS]", - Short: "Reload the Warewulf server configuration", - RunE: CobraRunE, - } -) - -func init() { -} - -// GetRootCommand returns the root cobra.Command for the application. -func GetCommand() *cobra.Command { - return baseCmd -} diff --git a/internal/app/wwctl/server/restart/main.go b/internal/app/wwctl/server/restart/main.go deleted file mode 100644 index d2b98fc24..000000000 --- a/internal/app/wwctl/server/restart/main.go +++ /dev/null @@ -1,15 +0,0 @@ -package restart - -import ( - "github.com/pkg/errors" - "github.com/spf13/cobra" - "github.com/warewulf/warewulf/internal/pkg/warewulfd" -) - -func CobraRunE(cmd *cobra.Command, args []string) error { - err := warewulfd.DaemonStop() - if err != nil { - return errors.Wrap(err, "failed to stop Warewulf server") - } - return errors.Wrap(warewulfd.DaemonStart(), "failed to start Warewulf server") -} diff --git a/internal/app/wwctl/server/restart/root.go b/internal/app/wwctl/server/restart/root.go deleted file mode 100644 index 12be5f979..000000000 --- a/internal/app/wwctl/server/restart/root.go +++ /dev/null @@ -1,20 +0,0 @@ -package restart - -import "github.com/spf13/cobra" - -var ( - baseCmd = &cobra.Command{ - DisableFlagsInUseLine: true, - Use: "restart [OPTIONS]", - Short: "Restart the Warewulf server", - RunE: CobraRunE, - } -) - -func init() { -} - -// GetRootCommand returns the root cobra.Command for the application. -func GetCommand() *cobra.Command { - return baseCmd -} diff --git a/internal/app/wwctl/server/root.go b/internal/app/wwctl/server/root.go index ef6380a44..2e8645491 100644 --- a/internal/app/wwctl/server/root.go +++ b/internal/app/wwctl/server/root.go @@ -1,33 +1,27 @@ package server import ( + "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/warewulf/warewulf/internal/app/wwctl/server/reload" - "github.com/warewulf/warewulf/internal/app/wwctl/server/restart" - "github.com/warewulf/warewulf/internal/app/wwctl/server/start" - "github.com/warewulf/warewulf/internal/app/wwctl/server/status" - "github.com/warewulf/warewulf/internal/app/wwctl/server/stop" + "github.com/warewulf/warewulf/internal/pkg/warewulfd" ) var ( baseCmd = &cobra.Command{ DisableFlagsInUseLine: true, - Use: "server COMMAND [OPTIONS]", - Short: "Warewulf server process commands", - Long: "This command will allow you to control the Warewulf daemon process.", + Use: "server [OPTIONS]", + Short: "Start Warewulf server", + RunE: CobraRunE, } ) -func init() { - baseCmd.AddCommand(start.GetCommand()) - baseCmd.AddCommand(status.GetCommand()) - baseCmd.AddCommand(stop.GetCommand()) - baseCmd.AddCommand(restart.GetCommand()) - baseCmd.AddCommand(reload.GetCommand()) - -} - -// GetRootCommand returns the root cobra.Command for the application. func GetCommand() *cobra.Command { return baseCmd } + +func CobraRunE(cmd *cobra.Command, args []string) error { + if err := warewulfd.DaemonInitLogging(); err != nil { + return errors.Wrap(err, "failed to configure logging") + } + return errors.Wrap(warewulfd.RunServer(), "failed to start Warewulf server") +} diff --git a/internal/app/wwctl/server/start/main.go b/internal/app/wwctl/server/start/main.go deleted file mode 100644 index be562d9e2..000000000 --- a/internal/app/wwctl/server/start/main.go +++ /dev/null @@ -1,19 +0,0 @@ -package start - -import ( - "github.com/pkg/errors" - "github.com/spf13/cobra" - warewulfconf "github.com/warewulf/warewulf/internal/pkg/config" - "github.com/warewulf/warewulf/internal/pkg/warewulfd" -) - -func CobraRunE(cmd *cobra.Command, args []string) error { - - if SetForeground { - conf := warewulfconf.Get() - conf.Warewulf.Syslog = false - return errors.Wrap(warewulfd.RunServer(), "failed to start Warewulf server") - } else { - return errors.Wrap(warewulfd.DaemonStart(), "failed to start Warewulf server") - } -} diff --git a/internal/app/wwctl/server/start/root.go b/internal/app/wwctl/server/start/root.go deleted file mode 100644 index ba0d02b09..000000000 --- a/internal/app/wwctl/server/start/root.go +++ /dev/null @@ -1,22 +0,0 @@ -package start - -import "github.com/spf13/cobra" - -var ( - baseCmd = &cobra.Command{ - DisableFlagsInUseLine: true, - Use: "start [OPTIONS]", - Short: "Start Warewulf server", - RunE: CobraRunE, - } - SetForeground bool -) - -func init() { - baseCmd.PersistentFlags().BoolVarP(&SetForeground, "foreground", "f", false, "Run daemon process in the foreground") -} - -// GetRootCommand returns the root cobra.Command for the application. -func GetCommand() *cobra.Command { - return baseCmd -} diff --git a/internal/app/wwctl/server/status/main.go b/internal/app/wwctl/server/status/main.go deleted file mode 100644 index 3744611f6..000000000 --- a/internal/app/wwctl/server/status/main.go +++ /dev/null @@ -1,10 +0,0 @@ -package status - -import ( - "github.com/spf13/cobra" - "github.com/warewulf/warewulf/internal/pkg/warewulfd" -) - -func CobraRunE(cmd *cobra.Command, args []string) error { - return warewulfd.DaemonStatus() -} diff --git a/internal/app/wwctl/server/status/root.go b/internal/app/wwctl/server/status/root.go deleted file mode 100644 index 396c44d36..000000000 --- a/internal/app/wwctl/server/status/root.go +++ /dev/null @@ -1,17 +0,0 @@ -package status - -import "github.com/spf13/cobra" - -var ( - baseCmd = &cobra.Command{ - DisableFlagsInUseLine: true, - Use: "status [OPTIONS]", - Short: "Warewulf server status", - RunE: CobraRunE, - } -) - -// GetRootCommand returns the root cobra.Command for the application. -func GetCommand() *cobra.Command { - return baseCmd -} diff --git a/internal/app/wwctl/server/stop/main.go b/internal/app/wwctl/server/stop/main.go deleted file mode 100644 index 089261090..000000000 --- a/internal/app/wwctl/server/stop/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package stop - -import ( - "github.com/pkg/errors" - "github.com/spf13/cobra" - "github.com/warewulf/warewulf/internal/pkg/warewulfd" -) - -func CobraRunE(cmd *cobra.Command, args []string) error { - return errors.Wrap(warewulfd.DaemonStop(), "failed to stop Warewulf server") -} diff --git a/internal/app/wwctl/server/stop/root.go b/internal/app/wwctl/server/stop/root.go deleted file mode 100644 index 02ec9808a..000000000 --- a/internal/app/wwctl/server/stop/root.go +++ /dev/null @@ -1,17 +0,0 @@ -package stop - -import "github.com/spf13/cobra" - -var ( - baseCmd = &cobra.Command{ - DisableFlagsInUseLine: true, - Use: "stop [OPTIONS]", - Short: "Stop Warewulf server", - RunE: CobraRunE, - } -) - -// GetRootCommand returns the root cobra.Command for the application. -func GetCommand() *cobra.Command { - return baseCmd -} diff --git a/internal/pkg/warewulfd/daemon.go b/internal/pkg/warewulfd/daemon.go index 816c958bf..e595f5097 100644 --- a/internal/pkg/warewulfd/daemon.go +++ b/internal/pkg/warewulfd/daemon.go @@ -60,7 +60,7 @@ func DaemonInitLogging() error { if conf.Warewulf.Syslog { - wwlog.Debug("Changingq log output to syslog") + wwlog.Debug("Changing log output to syslog") logwriter, err := syslog.New(syslog.LOG_NOTICE, "warewulfd") if err != nil { @@ -165,33 +165,15 @@ func DaemonReload() error { if nodaemon { return nil } - if !util.IsFile(WAREWULFD_PIDFILE) { - return errors.New("Warewulf server is not running") - } - - dat, err := os.ReadFile(WAREWULFD_PIDFILE) + cmd := exec.Command("/usr/sbin/service", "warewulfd", "reload") + err := cmd.Start() if err != nil { - return errors.Wrap(err, "could not read Warewulfd PID file") + return errors.Wrap(err, "failed to reload warewulfd") } - - pid, _ := strconv.Atoi(string(dat)) - process, err := os.FindProcess(pid) + err = cmd.Wait() if err != nil { - return errors.Wrap(err, "failed to find running PID") - } else { - err := process.Signal(syscall.Signal(syscall.SIGHUP)) - if err != nil { - return errors.Wrap(err, "failed to send process SIGHUP") - } + return errors.Wrap(err, "failed to reload warewulfd") } - - logLevel := wwlog.GetLogLevel() - if logLevel == wwlog.INFO { - os.Setenv("WAREWULFD_LOGLEVEL", strconv.Itoa(wwlog.SERV)) - } else { - os.Setenv("WAREWULFD_LOGLEVEL", strconv.Itoa(logLevel)) - } - return nil } diff --git a/internal/pkg/warewulfd/warewulfd.go b/internal/pkg/warewulfd/warewulfd.go index 0a7e1794c..94e3847fe 100644 --- a/internal/pkg/warewulfd/warewulfd.go +++ b/internal/pkg/warewulfd/warewulfd.go @@ -34,11 +34,6 @@ func (h *slashFix) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func RunServer() error { - err := DaemonInitLogging() - if err != nil { - return errors.Wrap(err, "Failed to initialize logging") - } - c := make(chan os.Signal, 1) signal.Notify(c, syscall.SIGHUP) @@ -57,7 +52,7 @@ func RunServer() error { } }() - err = LoadNodeDB() + err := LoadNodeDB() if err != nil { wwlog.Error("Could not load database: %s", err) } @@ -84,17 +79,6 @@ func RunServer() error { conf := warewulfconf.Get() daemonPort := conf.Warewulf.Port - /* - wwlog.Serv("Starting HTTPD REST service on port %d", daemonPort) - s := &http.Server{ - Addr: ":" + strconv.Itoa(daemonPort), - Handler: &slashFix{&wwHandler}, - ReadTimeout: 10 * time.Second, - IdleTimeout: 10 * time.Second, - WriteTimeout: 10 * time.Second, - } - err = s.ListenAndServe() - */ err = http.ListenAndServe(":"+strconv.Itoa(daemonPort), &slashFix{&wwHandler}) if err != nil { diff --git a/userdocs/contents/configuration.rst b/userdocs/contents/configuration.rst index 238f8bc9c..37c7e3b01 100644 --- a/userdocs/contents/configuration.rst +++ b/userdocs/contents/configuration.rst @@ -114,8 +114,7 @@ explained as follows: services.) * ``warewulf:syslog``: This determines whether Warewulf server logs go - to syslog or are written directly to a log file. (e.g., - ``/var/log/warewulfd.log``) + to syslog. * ``nfs:export paths``: Warewulf can automatically set up these NFS exports. diff --git a/userdocs/contents/initialization.rst b/userdocs/contents/initialization.rst index 6d56a42f9..79a374f56 100644 --- a/userdocs/contents/initialization.rst +++ b/userdocs/contents/initialization.rst @@ -48,22 +48,3 @@ systemd service: .. code-block:: console # systemctl enable --now warewulfd - -You can also check and control the Warewulf service using the ``wwctl`` -command line program as follows: - -.. code-block:: console - - # wwctl server status - -.. note:: - - If the Warewulf service is running via systemd, restarting - stopping, and starting it from the ``wwctl`` command may result in - unexpected results. - -Logs ----- - -The Warewulf server logs are by default written to -``/var/log/warewulfd.log``. diff --git a/userdocs/contributing/development-environment-kvm.rst b/userdocs/contributing/development-environment-kvm.rst index 3f981652c..1abd3e99a 100644 --- a/userdocs/contributing/development-environment-kvm.rst +++ b/userdocs/contributing/development-environment-kvm.rst @@ -121,8 +121,6 @@ Build and install Warewulf on wwdev sudo wwctl overlay build -a # Start the Warewulf daemon - sudo wwctl ready - sudo wwctl server start - sudo wwctl server status + sudo wwctl server & Boot your node and watch the bash and the output of the Warewulfd process diff --git a/userdocs/contributing/development-environment-vagrant.rst b/userdocs/contributing/development-environment-vagrant.rst index 40c0c4d88..8d8944b7b 100644 --- a/userdocs/contributing/development-environment-vagrant.rst +++ b/userdocs/contributing/development-environment-vagrant.rst @@ -223,7 +223,7 @@ Vagrantfile systemd name: nfs-server CONF - sed -i 's@ExecStart=/usr/bin/wwctl server start@ExecStart=/usr/bin/wwctl server start -d -v@' /usr/lib/systemd/system/warewulfd.service + sed -i 's@ExecStart=/usr/bin/wwctl server@ExecStart=/usr/bin/wwctl server -d -v@' /usr/lib/systemd/system/warewulfd.service systemctl enable --now warewulfd wwctl configure --all diff --git a/userdocs/contributing/development-environment-vbox.rst b/userdocs/contributing/development-environment-vbox.rst index 17c9f16b8..577bae524 100644 --- a/userdocs/contributing/development-environment-vbox.rst +++ b/userdocs/contributing/development-environment-vbox.rst @@ -137,9 +137,7 @@ I have VirtualBox running on my desktop. sudo wwctl overlay build -a # Start the Warewulf daemon - sudo wwctl ready - sudo wwctl server start - sudo wwctl server status + sudo wwctl server & 4. Create a new guest VM instance inside the VirtualBox to be the Warewulf client/compute node. Under the system configuration make From d33ca6ff5301ecbc3741bf3fc0650f6ba36016b9 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Fri, 24 May 2024 17:10:45 -0600 Subject: [PATCH 2/2] Simplify warewulfd logging - Collapse SEND and RECV logs into INFO. - Add /etc/default/warewulfd Closes #725 Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 2 ++ include/systemd/warewulfd.service.in | 1 + internal/pkg/warewulfd/daemon.go | 2 +- internal/pkg/warewulfd/provision.go | 4 ++-- internal/pkg/warewulfd/util.go | 2 +- internal/pkg/wwlog/wwlog.go | 12 +----------- internal/pkg/wwlog/wwlog_test.go | 14 -------------- 7 files changed, 8 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79f4eb1b4..926aa7123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add flag `--build` to `wwctl container copy`. #1378 - Add `wwctl clean` to remove OCI cache and overlays from deleted nodes - Add `wwctl container import --platform`. #1381 +- Read environment variables from `/etc/default/warewulfd` #725 ### Changed @@ -46,6 +47,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Updated various shell scripts for POSIX compatibility. #1464 - Update `wwctl server` to always run in the foreground #508 - Update `wwctl server` to log to stdout rather than a file #503 +- Changed `wwctl server` to use "INFO" for send and receive logs #725 ### Removed diff --git a/include/systemd/warewulfd.service.in b/include/systemd/warewulfd.service.in index 6ba38606e..249f370ae 100644 --- a/include/systemd/warewulfd.service.in +++ b/include/systemd/warewulfd.service.in @@ -6,6 +6,7 @@ AssertFileIsExecutable=@BINDIR@/wwctl [Service] Type=exec +EnvironmentFile=-/etc/default/warewulfd User=root Group=root ExecStart=@BINDIR@/wwctl server diff --git a/internal/pkg/warewulfd/daemon.go b/internal/pkg/warewulfd/daemon.go index e595f5097..b60563a59 100644 --- a/internal/pkg/warewulfd/daemon.go +++ b/internal/pkg/warewulfd/daemon.go @@ -53,7 +53,7 @@ func DaemonInitLogging() error { wwlog.SetLogLevel(level) } } else { - wwlog.SetLogLevel(wwlog.SERV) + wwlog.SetLogLevel(wwlog.INFO) } conf := warewulfconf.Get() diff --git a/internal/pkg/warewulfd/provision.go b/internal/pkg/warewulfd/provision.go index 0ccf5eeac..9426e067a 100644 --- a/internal/pkg/warewulfd/provision.go +++ b/internal/pkg/warewulfd/provision.go @@ -48,7 +48,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) { return } - wwlog.Recv("hwaddr: %s, ipaddr: %s, stage: %s", rinfo.hwaddr, req.RemoteAddr, rinfo.stage) + wwlog.Info("request from hwaddr:%s ipaddr:%s | stage:%s", rinfo.hwaddr, req.RemoteAddr, rinfo.stage) if (rinfo.stage == "runtime" || len(rinfo.overlay) > 0) && conf.Warewulf.Secure { if rinfo.remoteport >= 1024 { @@ -276,7 +276,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) { wwlog.ErrorExc(err, "") } - wwlog.Send("%15s: %s", remoteNode.Id(), stage_file) + wwlog.Info("send %s -> %s", stage_file, remoteNode.Id()) } else { if rinfo.compress == "gz" { diff --git a/internal/pkg/warewulfd/util.go b/internal/pkg/warewulfd/util.go index 240086223..0ba049218 100644 --- a/internal/pkg/warewulfd/util.go +++ b/internal/pkg/warewulfd/util.go @@ -39,7 +39,7 @@ func sendFile( stat.ModTime(), fd) - wwlog.Send("%15s: %s", sendto, filename) + wwlog.Info("send %s -> %s", filename, sendto) req.Body.Close() return nil } diff --git a/internal/pkg/wwlog/wwlog.go b/internal/pkg/wwlog/wwlog.go index bd8b61797..284c29506 100644 --- a/internal/pkg/wwlog/wwlog.go +++ b/internal/pkg/wwlog/wwlog.go @@ -37,8 +37,6 @@ var ( SECWARN = SetLevelName(31, "SECWARN") WARN = SetLevelName(30, "WARN") ERROUT = SetLevelName(29, "ERROUT") - SEND = SetLevelName(27, "SEND") - RECV = SetLevelName(26, "RECV") SERV = SetLevelName(25, "SERV") OUT = SetLevelName(22, "OUT") SECINFO = SetLevelName(21, "SECINFO") @@ -206,7 +204,7 @@ func LogCaller(level int, skip int, err error, message string, a ...interface{}) } message = logFormatter(logLevel, &rec) - if level == INFO || level == RECV || level == SEND || level == OUT { + if level == INFO || level == OUT { fmt.Fprint(logOut, message) } else { fmt.Fprint(logErr, message) @@ -271,14 +269,6 @@ func Serv(message string, a ...interface{}) { LogCaller(SERV, 1, nil, message, a...) } -func Recv(message string, a ...interface{}) { - LogCaller(RECV, 1, nil, message, a...) -} - -func Send(message string, a ...interface{}) { - LogCaller(SEND, 1, nil, message, a...) -} - func Warn(message string, a ...interface{}) { LogCaller(WARN, 1, nil, message, a...) } diff --git a/internal/pkg/wwlog/wwlog_test.go b/internal/pkg/wwlog/wwlog_test.go index 72d618992..1c0ed4ed3 100644 --- a/internal/pkg/wwlog/wwlog_test.go +++ b/internal/pkg/wwlog/wwlog_test.go @@ -126,20 +126,6 @@ func Test_Log(t *testing.T) { expect: "SERV : Serv\n", exactMatch: true, }, - { - name: "Recv", - msgTypeFunc: Recv, - message: "Recv", - expect: "RECV : Recv\n", - exactMatch: true, - }, - { - name: "Send", - msgTypeFunc: Send, - message: "Send", - expect: "SEND : Send\n", - exactMatch: true, - }, { name: "Warn", msgTypeFunc: Warn,