Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

casync-http: Log downloaded chunks with debug level (was info) #191

Merged

Conversation

elboulangero
Copy link
Contributor

With this commit, one must set casync log level to debug in order to see
each downloaded chunks (additionally to setting the verbose flag).

casync -v --log-level=debug extract ...

Signed-off-by: Arnaud Rebillout [email protected]

@@ -315,7 +315,7 @@ static int acquire_file(CaRemote *rr,
}

if (arg_verbose)
log_info("Acquiring %s...", url);
log_debug("Acquiring %s...", url);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only changed the log level, but I also wondered if we should remove arg_verbose here. And more generally, how is verbose supposed to play along log levels?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, log_debug stuff should be unaffected by arg_verbose. Hence, it's fine to downgrade this, but then also please drop the conditionalization by arg_verbose

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@poettering
Copy link
Member

How "-v" and the log levels interact is a good question. The "-v" option was supposed to be something like tar's "v" switch, i.e. just show some most high-level progress info about what we are processing (i.e. which path we are looking at). I think it would make sense to stick to that, and probably not overload it with anything else.

Right now arg_verbose is also used to show the stats at the end and a couple of other things, which I either should be removed, or also be individually selectable (since I figure running casync without path progress info but with stats should be very useful, the opposite probably not so much...)

So here's my proposal:

  1. Have "-v" for "path progress info", i.e. the "tar" behaviour, i.e. lines showing us where we currently are in the file system, but nothing else really, except for stats, see below.
  2. Add a new --statistics switch (-s) that only shows the statistics at the end. -v would imply -s, but not vice versa.
  3. For everything else there would be the log levels. And I think it would be great if the effect of "-v" and "-s" would only be that some specific log messages get switched between LOG_DEBUG and LOG_INFO. i.e. so that we always generate the same log output, except at different levels. Implementation idea would be to have two log functions log_statistics() and log_progress() or so, which are wrappers for log_full() but use LOG_INFO and LOG_DEBUG depending on arg_statistics and arg_verbose, if you follow what I mean...

Does that make sense?

With this commit, one must set casync log level to debug in order to see
each downloaded chunks.

    CASYNC_LOG_LEVEL=debug casync extract ...

Signed-off-by: Arnaud Rebillout <[email protected]>
@elboulangero elboulangero force-pushed the mr/downloaded-chunks-log-debug branch from 75bb5a4 to e869cd6 Compare February 26, 2019 03:48
@elboulangero
Copy link
Contributor Author

It all makes sense, I can work on that while I'm at it. I propose to open a new task maybe, like Rework -v behavior or something?

@poettering
Copy link
Member

It all makes sense, I can work on that while I'm at it. I propose to open a new task maybe, like Rework -v behavior or something?

task? is that a github concept? by all means

@poettering poettering merged commit c603308 into systemd:master Feb 26, 2019
@elboulangero elboulangero deleted the mr/downloaded-chunks-log-debug branch March 19, 2019 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants