LogFile creates a file on disk that logs the task's STDOUT,STDERR. If the log file already exists, the logs will be appended to the file.
(path string)
| 274 | // LogFile creates a file on disk that logs the task's STDOUT,STDERR. |
| 275 | // If the log file already exists, the logs will be appended to the file. |
| 276 | func LogFile(path string) Creator { |
| 277 | return func(_ string) (IO, error) { |
| 278 | uri, err := LogURIGenerator("file", path, nil) |
| 279 | if err != nil { |
| 280 | return nil, err |
| 281 | } |
| 282 | |
| 283 | res := uri.String() |
| 284 | return &logURI{ |
| 285 | config: Config{ |
| 286 | Stdout: res, |
| 287 | Stderr: res, |
| 288 | }, |
| 289 | }, nil |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | // LogURIGenerator is the helper to generate log uri with specific scheme. |
| 294 | func LogURIGenerator(scheme string, path string, args map[string]string) (*url.URL, error) { |
searching dependent graphs…