History

fftools/opt_common: add time and datetime log flags

This commit adds two logging flags: 'time' and 'datetime'. Usage: ffmpeg -loglevel +time or ffmpeg -loglevel +datetime

softworkz committed 1 year ago

Commit 9fd23f71 parent c79cdae2 files · +16 −0Browse files

Unified · Split

2 files
  1. doc/fftools-common-opts.texi +4 −0
  2. fftools/opt_common.c +12 −0
doc/fftools-common-opts.texi+4−0
@@ -226,6 +226,10 @@ and the "Last message repeated n times" line will be omitted. · 225 unmodified lines
226Indicates that log output should add a @code{[level]} prefix to each message226Indicates that log output should add a @code{[level]} prefix to each message
227line. This can be used as an alternative to log coloring, e.g. when dumping the227line. This can be used as an alternative to log coloring, e.g. when dumping the
228log to file.228log to file.
229@item time
230Indicates that log lines should be prefixed with time information.
231@item datetime
232Indicates that log lines should be prefixed with date and time information.
229@end table233@end table
230Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single234Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
231flag without affecting other @var{flags} or changing @var{loglevel}. When235flag without affecting other @var{flags} or changing @var{loglevel}. When
fftools/opt_common.c+12−0
@@ -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 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t