@@ -535,13 +535,15 @@ func (b *Batcher) Run(ctx context.Context) error {
535535 case sweepReq := <- b .sweepReqs :
536536 sweep , err := b .fetchSweep (runCtx , sweepReq )
537537 if err != nil {
538- log .Warnf ("fetchSweep failed: %v." , err )
538+ log ().Warnf ("fetchSweep failed: %v." , err )
539+
539540 return err
540541 }
541542
542543 err = b .handleSweep (runCtx , sweep , sweepReq .Notifier )
543544 if err != nil {
544- log .Warnf ("handleSweep failed: %v." , err )
545+ log ().Warnf ("handleSweep failed: %v." , err )
546+
545547 return err
546548 }
547549
@@ -550,11 +552,13 @@ func (b *Batcher) Run(ctx context.Context) error {
550552 close (testReq .quit )
551553
552554 case err := <- b .errChan :
553- log .Warnf ("Batcher received an error: %v." , err )
555+ log ().Warnf ("Batcher received an error: %v." , err )
556+
554557 return err
555558
556559 case <- runCtx .Done ():
557- log .Infof ("Stopping Batcher: run context cancelled." )
560+ log ().Infof ("Stopping Batcher: run context cancelled." )
561+
558562 return runCtx .Err ()
559563 }
560564 }
@@ -614,8 +618,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
614618 return err
615619 }
616620
617- log .Infof ("Batcher handling sweep %x, completed=%v" , sweep . swapHash [: 6 ] ,
618- completed )
621+ log () .Infof ("Batcher handling sweep %x, completed=%v" ,
622+ sweep . swapHash [: 6 ], completed )
619623
620624 // If the sweep has already been completed in a confirmed batch then we
621625 // can't attach its notifier to the batch as that is no longer running.
@@ -626,8 +630,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
626630 // on-chain confirmations to prevent issues caused by reorgs.
627631 parentBatch , err := b .store .GetParentBatch (ctx , sweep .swapHash )
628632 if err != nil {
629- log .Errorf ("unable to get parent batch for sweep %x: " +
630- "%v" , sweep .swapHash [:6 ], err )
633+ log () .Errorf ("unable to get parent batch for sweep %x:" +
634+ " %v" , sweep .swapHash [:6 ], err )
631635
632636 return err
633637 }
@@ -679,8 +683,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
679683 return nil
680684 }
681685
682- log .Warnf ("Greedy batch selection algorithm failed for sweep %x: %v. " +
683- "Falling back to old approach." , sweep .swapHash [:6 ], err )
686+ log () .Warnf ("Greedy batch selection algorithm failed for sweep %x: %v." +
687+ " Falling back to old approach." , sweep .swapHash [:6 ], err )
684688
685689 // If one of the batches accepts the sweep, we provide it to that batch.
686690 for _ , batch := range b .batches {
@@ -785,13 +789,13 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
785789 }
786790
787791 if len (dbSweeps ) == 0 {
788- log .Infof ("skipping restored batch %d as it has no sweeps" ,
792+ log () .Infof ("skipping restored batch %d as it has no sweeps" ,
789793 batch .id )
790794
791795 // It is safe to drop this empty batch as it has no sweeps.
792796 err := b .store .DropBatch (ctx , batch .id )
793797 if err != nil {
794- log .Warnf ("unable to drop empty batch %d: %v" ,
798+ log () .Warnf ("unable to drop empty batch %d: %v" ,
795799 batch .id , err )
796800 }
797801
@@ -933,7 +937,7 @@ func (b *Batcher) monitorSpendAndNotify(ctx context.Context, sweep *sweep,
933937 b .wg .Add (1 )
934938 go func () {
935939 defer b .wg .Done ()
936- log .Infof ("Batcher monitoring spend for swap %x" ,
940+ log () .Infof ("Batcher monitoring spend for swap %x" ,
937941 sweep .swapHash [:6 ])
938942
939943 for {
@@ -1112,7 +1116,7 @@ func (b *Batcher) loadSweep(ctx context.Context, swapHash lntypes.Hash,
11121116 }
11131117 } else {
11141118 if s .ConfTarget == 0 {
1115- log .Warnf ("Fee estimation was requested for zero " +
1119+ log () .Warnf ("Fee estimation was requested for zero " +
11161120 "confTarget for sweep %x." , swapHash [:6 ])
11171121 }
11181122 minFeeRate , err = b .wallet .EstimateFeeRate (ctx , s .ConfTarget )
0 commit comments