[Spice-devel] [PATCH spice-streaming-agent 4/4] Add option to disable logging full frames
Christophe Fergeau
cfergeau at redhat.com
Thu Apr 26 09:53:40 UTC 2018
On Mon, Apr 23, 2018 at 04:07:44PM +0100, Frediano Ziglio wrote:
> In some cases we want to avoid saving huge amount of data on the log.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> src/spice-streaming-agent.cpp | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
> index 503c3b5..ab663cb 100644
> --- a/src/spice-streaming-agent.cpp
> +++ b/src/spice-streaming-agent.cpp
> @@ -59,6 +59,7 @@ struct SpiceStreamDataMessage
> static bool streaming_requested = false;
> static bool quit_requested = false;
> static bool log_binary = false;
> +static bool log_no_frames = false;
> static std::set<SpiceVideoCodecType> client_codecs;
> static int streamfd = -1;
> static std::mutex stream_mtx;
> @@ -458,7 +459,7 @@ do_capture(const char *streamport, FILE *f_log)
> }
> }
> STAT_LOG("Frame of %zu bytes:", frame.buffer_size);
> - if (f_log) {
> + if (f_log && !log_no_frames) {
> if (log_binary) {
> fwrite(frame.buffer, frame.buffer_size, 1, f_log);
> } else {
> @@ -498,10 +499,12 @@ int main(int argc, char* argv[])
> OPT_first = UCHAR_MAX,
> OPT_PLUGINS_DIR,
> OPT_LOG_BINARY,
> + OPT_NO_LOG_FRAMES,
> };
> static const struct option long_options[] = {
> { "plugins-dir", required_argument, NULL, OPT_PLUGINS_DIR},
> { "log-binary", no_argument, NULL, OPT_LOG_BINARY},
> + { "no-log-frames", no_argument, NULL, OPT_NO_LOG_FRAMES},
I don't think we want to add one additional command line option for each log
category (I'd consider frame logging to be one category).
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180426/f18f3cc3/attachment.sig>
More information about the Spice-devel
mailing list