This commit adds two logging flags: 'time' and 'datetime'. Usage: ffmpeg -loglevel +time or ffmpeg -loglevel +datetime
Unified · Split
| @@ -226,6 +226,10 @@ and the "Last message repeated n times" line will be omitted. · 225 unmodified lines | |||
| 226 | Indicates that log output should add a @code{[level]} prefix to each message | 226 | Indicates that log output should add a @code{[level]} prefix to each message |
| 227 | line. This can be used as an alternative to log coloring, e.g. when dumping the | 227 | line. This can be used as an alternative to log coloring, e.g. when dumping the |
| 228 | log to file. | 228 | log to file. |
| 229 | @item time | ||
| 230 | Indicates that log lines should be prefixed with time information. | ||
| 231 | @item datetime | ||
| 232 | Indicates that log lines should be prefixed with date and time information. | ||
| 229 | @end table | 233 | @end table |
| 230 | Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single | 234 | Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single |
| 231 | flag without affecting other @var{flags} or changing @var{loglevel}. When | 235 | flag without affecting other @var{flags} or changing @var{loglevel}. When |
| @@ -1292,6 +1292,18 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) · 1291 unmodified lines | |||
| 1292 | } else { | 1292 | } else { |
| 1293 | flags |= AV_LOG_PRINT_LEVEL; | 1293 | flags |= AV_LOG_PRINT_LEVEL; |
| 1294 | } | 1294 | } |
| 1295 | } else if (av_strstart(token, "time", &arg)) { | ||
| 1296 | if (cmd == '-') { | ||
| 1297 | flags &= ~AV_LOG_PRINT_TIME; | ||
| 1298 | } else { | ||
| 1299 | flags |= AV_LOG_PRINT_TIME; | ||
| 1300 | } | ||
| 1301 | } else if (av_strstart(token, "datetime", &arg)) { | ||
| 1302 | if (cmd == '-') { | ||
| 1303 | flags &= ~AV_LOG_PRINT_DATETIME; | ||
| 1304 | } else { | ||
| 1305 | flags |= AV_LOG_PRINT_DATETIME; | ||
| 1306 | } | ||
| 1295 | } else { | 1307 | } else { |
| 1296 | break; | 1308 | break; |
| 1297 | } | 1309 | } |