You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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 Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
c79cdae377
commit
9fd23f712a
@@ -226,6 +226,10 @@ and the "Last message repeated n times" line will be omitted.
|
|||||||
Indicates that log output should add a @code{[level]} prefix to each message
|
Indicates that log output should add a @code{[level]} prefix to each message
|
||||||
line. This can be used as an alternative to log coloring, e.g. when dumping the
|
line. This can be used as an alternative to log coloring, e.g. when dumping the
|
||||||
log to file.
|
log to file.
|
||||||
|
@item time
|
||||||
|
Indicates that log lines should be prefixed with time information.
|
||||||
|
@item datetime
|
||||||
|
Indicates that log lines should be prefixed with date and time information.
|
||||||
@end table
|
@end table
|
||||||
Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
|
Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
|
||||||
flag without affecting other @var{flags} or changing @var{loglevel}. When
|
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)
|
|||||||
} else {
|
} else {
|
||||||
flags |= AV_LOG_PRINT_LEVEL;
|
flags |= AV_LOG_PRINT_LEVEL;
|
||||||
}
|
}
|
||||||
|
} else if (av_strstart(token, "time", &arg)) {
|
||||||
|
if (cmd == '-') {
|
||||||
|
flags &= ~AV_LOG_PRINT_TIME;
|
||||||
|
} else {
|
||||||
|
flags |= AV_LOG_PRINT_TIME;
|
||||||
|
}
|
||||||
|
} else if (av_strstart(token, "datetime", &arg)) {
|
||||||
|
if (cmd == '-') {
|
||||||
|
flags &= ~AV_LOG_PRINT_DATETIME;
|
||||||
|
} else {
|
||||||
|
flags |= AV_LOG_PRINT_DATETIME;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user