-------- Original-Nachricht -------- > Datum: Tue, 8 Jul 2008 14:52:20 +0700 > Von: "Theppitak Karoonboonyanan" <[EMAIL PROTECTED]> > An: "Eduard Bloch" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > Betreff: Bug#489713: apt-cacher-ng: Transfer log should be flushed by default
> On Tue, Jul 8, 2008 at 2:20 PM, Eduard Bloch <[EMAIL PROTECTED]> wrote: > > #include <hallo.h> > > * Theppitak Karoonboonyanan [Mon, Jul 07 2008, 05:35:27PM]: > >> Package: apt-cacher-ng > >> Version: 0.2-1 > >> Severity: minor > >> > >> In many situations, it should be useful to be able to keep track of > what > >> apt-cacher-ng is doing at real time, not even for serious debugging. > >> For example, to monitor successful downloads for long-waited files. > >> It shouldn't require setting extra debug level to see real-time logs. > > > > ?? > > > > For serious debugging, you just set debug level, at least to 1. For fun > > debugging there is no point because you won't get realtime information; > > ATM the log stores the transfered size, and you get it only when the > > file is finished. > > > > So what exactly do you wish? More log entries, e.g. when a download is > > started and when it ends? > > Whatever it logs should be immediately flushed. > > By 'tail -f /var/log/apt-cacher.log', one still sees incomplete lines due > to > buffering, or many lines flushed at once, rather than in sync with each > finished transfer, unless debug level is set to at least 4. > > In source/aclogger.cc (transfer()): > > fprintf(fStat, acfg::verboselog ? "%lu|%c|%"PRIu64"|%s|%s\n" : > "%lu|%c|%"PRIu64"\n", > (unsigned long) time(NULL), bDirIn ? 'I' : 'O', > nCount, > szClient, szPath); > > if(acfg::debug>3) > fflush(fStat); > > Why fflush(fStat) only on debug > 3? Why not always? Obviously to have less harddisk seeks (even if that's about peanuts). I think I will make the flushing default now and add an explicit option to the configuration pool to disable it. Maybe something like: LogVerbosity: 0 (compact lines, buffered) or 1(compact lines, flushed linewise) or 2(extra logging of process state) I think this should be close to your expectations. Mode 2 would print stuff like: Request received for file bla... Download starting for file bla... Download finished for file bla... Job finished (date, transfer size, ... as usual) -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]