diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-10 23:55:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 23:55:45 +0100 |
commit | 0e9c208d3f9fc6f160f7e7746119ddf99ae6f220 (patch) | |
tree | 858cfc2d1b6867ee9c81b6897f5ce802811a8fc4 /libpod/options.go | |
parent | 40a16ee4c36aa143d3b27da9189d16afce35740d (diff) | |
parent | 4726eb2861e72a079ed337371182226a666c541a (diff) | |
download | podman-0e9c208d3f9fc6f160f7e7746119ddf99ae6f220.tar.gz podman-0e9c208d3f9fc6f160f7e7746119ddf99ae6f220.tar.bz2 podman-0e9c208d3f9fc6f160f7e7746119ddf99ae6f220.zip |
Merge pull request #4805 from giuseppe/log-tag
log: support --log-opt tag=
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index 031f4f705..1d6863e7b 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1059,6 +1059,23 @@ func WithLogPath(path string) CtrCreateOption { } } +// WithLogTag sets the tag to the log file. +func WithLogTag(tag string) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return define.ErrCtrFinalized + } + if tag == "" { + return errors.Wrapf(define.ErrInvalidArg, "log tag must be set") + } + + ctr.config.LogTag = tag + + return nil + } + +} + // WithNoCgroups disables the creation of CGroups for the new container. func WithNoCgroups() CtrCreateOption { return func(ctr *Container) error { |