[Spice-devel] [PATCH spice-streaming-agent 4/4] Add option to disable logging full frames
Christophe Fergeau
cfergeau at redhat.com
Thu Apr 26 11:50:48 UTC 2018
On Thu, Apr 26, 2018 at 07:29:56AM -0400, Frediano Ziglio wrote:
> >
> > 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
> >
>
> In another project I used a bit flag, would be ok?
Sorry, my mail was very terse. Maybe something similar to
G_MESSAGES_DEBUG, ie "frames:jitter:xxx" if that can work this way (can
be a command line option rather than an env var, or both).
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/5128fce8/attachment.sig>
More information about the Spice-devel
mailing list