summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-10 23:55:45 +0100
committerGitHub <noreply@github.com>2020-01-10 23:55:45 +0100
commit0e9c208d3f9fc6f160f7e7746119ddf99ae6f220 (patch)
tree858cfc2d1b6867ee9c81b6897f5ce802811a8fc4 /libpod/options.go
parent40a16ee4c36aa143d3b27da9189d16afce35740d (diff)
parent4726eb2861e72a079ed337371182226a666c541a (diff)
downloadpodman-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.go17
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 {