diff --git a/api/tasks.go b/api/tasks.go index 04056da21..8b2ae3927 100644 --- a/api/tasks.go +++ b/api/tasks.go @@ -133,6 +133,12 @@ func (t *Task) Constrain(c *Constraint) *Task { return t } +// SetLogConfig sets a log config to a task +func (t *Task) SetLogConfig(l *LogConfig) *Task { + t.LogConfig = l + return t +} + // TaskState tracks the current state of a task and events that caused state // transistions. type TaskState struct { diff --git a/api/util_test.go b/api/util_test.go index 30feafdd3..190e0f3e7 100644 --- a/api/util_test.go +++ b/api/util_test.go @@ -26,6 +26,10 @@ func testJob() *Job { MemoryMB: 256, DiskMB: 25, IOPS: 10, + }). + SetLogConfig(&LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, }) group := NewTaskGroup("group1", 1).