lychee icon indicating copy to clipboard operation
lychee copied to clipboard

Cache usage not logged

Open tooomm opened this issue 1 year ago • 5 comments

On cache expiry, a helpful message is print:

Cache is too old (age: 9days 23h 47m 11s 823ms 371us 801ns, max age: 8h). Discarding
 ✗ [404] https://*URL | Network error: Not Found

If cache is used, nothing shows up. I just realized that it probably works because I had an error cached and that popped up.

 ↻ [404] https://*URL | Error (cached)

I think some similar information would be very helpful there as well:

Cache is recent (age: 2h 47m 11s 823ms 371us 801ns, max age: 8h). Using
 ↻ [404] https://*URL | Error (cached)

tooomm avatar Jul 30 '22 21:07 tooomm

it should be hidden by default but be turned on with -v or -vv flag.

lebensterben avatar Jul 30 '22 21:07 lebensterben

@lebensterben is probably right.

mre avatar Jul 31 '22 02:07 mre

it should be hidden by default but be turned on with -v or -vv flag.

Hmm. Considering that --verbose/ -v can print hundreds or thousands of lines below that single Cache is used line we are talking about, I'm not so sure if it would be that useful at all then. It's easily buried by other information and not recognized.

What about a simple else here? https://github.com/lycheeverse/lychee/blob/master/lychee-bin/src/main.rs#L179-L186


It looks like -vv is not even documented? 🤔

tooomm avatar Jul 31 '22 09:07 tooomm

@tooomm

When everything is working fine the program should not emit any noise except the simple status of success. That's why I think it should not report a good cache.

lebensterben avatar Jul 31 '22 16:07 lebensterben

What about a simple else here? https://github.com/lycheeverse/lychee/blob/master/lychee-bin/src/main.rs#L179-L186

Kinda leaning towards what @lebensterben said: if it works as expected let's not make the output more verbose.

It looks like -vv is not even documented? 🤔

That's because it doesn't exist yet. 😆 We should add that and print the message.

mre avatar Aug 11 '22 15:08 mre

Fixed with #824.

mre avatar Nov 28 '22 22:11 mre