@@ -156,7 +156,7 @@ private async Task<bool> Upgrade(Account acc)
156
156
157
157
if ( lvl >= _buildingTask . Level )
158
158
{
159
- acc . Logger . Information ( $ "{ _buildingTask . Building } is already level { lvl } in village { Vill . Name } . Will be removed from the queue.") ;
159
+ acc . Logger . Information ( $ "{ _buildingTask . Building } is already level { lvl } in village { Vill . Name } . Will be removed from the queue.", this ) ;
160
160
RemoveCurrentTask ( ) ;
161
161
return false ;
162
162
}
@@ -165,7 +165,7 @@ private async Task<bool> Upgrade(Account acc)
165
165
var buttons = container ? . Descendants ( "button" ) ;
166
166
if ( buttons == null )
167
167
{
168
- acc . Logger . Warning ( $ "We wanted to upgrade { _buildingTask . Building } , but no 'upgrade' button was found! Url={ acc . Wb . CurrentUrl } ") ;
168
+ acc . Logger . Information ( $ "We wanted to upgrade { _buildingTask . Building } , but no 'upgrade' button was found! Url={ acc . Wb . CurrentUrl } ", this ) ;
169
169
return false ;
170
170
}
171
171
@@ -178,20 +178,21 @@ private async Task<bool> Upgrade(Account acc)
178
178
179
179
if ( upgradeButton == null )
180
180
{
181
- acc . Logger . Warning ( $ "We wanted to upgrade { _buildingTask . Building } , but no 'upgrade' button was found!") ;
181
+ acc . Logger . Information ( $ "We wanted to upgrade { _buildingTask . Building } , but no 'upgrade' button was found!", this ) ;
182
182
return false ;
183
183
}
184
184
185
185
// Not enough resources?
186
186
if ( acc . AccInfo . ServerVersion == ServerVersionEnum . T4_5 && errorMessage != null )
187
187
{
188
- acc . Logger . Warning ( $ "We wanted to upgrade { _buildingTask . Building } , but there was an error message:\n { errorMessage . InnerText } ") ;
188
+ acc . Logger . Information ( $ "We wanted to upgrade { _buildingTask . Building } , but there was an error message:\n { errorMessage . InnerText } ", this ) ;
189
189
return false ;
190
190
}
191
191
192
192
var buildDuration = InfrastructureParser . GetBuildDuration ( container , acc . AccInfo . ServerVersion ) ;
193
193
194
- acc . Logger . Information ( $ "Started upgrading { _buildingTask . Building } to level { lvl + 1 } in { Vill . Name } ") ;
194
+ acc . Logger . Information ( "Complete checking" , this ) ;
195
+ acc . Logger . Information ( $ "Upgrading { _buildingTask . Building } to level { lvl + 1 } in { Vill . Name } ", this ) ;
195
196
196
197
var watchAd = false ;
197
198
if ( acc . AccInfo . ServerVersion == ServerVersionEnum . T4_5 && buildDuration . TotalMinutes > acc . Settings . WatchAdAbove )
@@ -205,7 +206,7 @@ private async Task<bool> Upgrade(Account acc)
205
206
await DriverHelper . ClickById ( acc , upgradeButton . Id ) ; // Normal upgrade
206
207
}
207
208
208
- acc . Logger . Information ( $ "Upgraded { _buildingTask . Building } to level { lvl + 1 } in { Vill . Name } ") ;
209
+ acc . Logger . Information ( $ "Upgraded { _buildingTask . Building } to level { lvl + 1 } in { Vill . Name } ", this ) ;
209
210
if ( _buildingTask . Level == lvl + 1 )
210
211
{
211
212
RemoveCurrentTask ( ) ;
@@ -514,7 +515,7 @@ private async Task<bool> IsEnoughRes(Account acc)
514
515
var resWrapper = contractNode . Descendants ( ) . FirstOrDefault ( x => x . HasClass ( "resourceWrapper" ) ) ;
515
516
var cost = ResourceParser . GetResourceCost ( resWrapper ) ;
516
517
517
- acc . Logger . Information ( $ "Need { cost } ") ;
518
+ acc . Logger . Information ( $ "Need { cost } ", this ) ;
518
519
519
520
if ( ! ResourcesHelper . IsEnoughRes ( Vill , cost . ToArray ( ) ) )
520
521
{
@@ -527,7 +528,7 @@ private async Task<bool> IsEnoughRes(Account acc)
527
528
}
528
529
529
530
var stillNeededRes = ResourcesHelper . SubtractResources ( cost . ToArray ( ) , Vill . Res . Stored . Resources . ToArray ( ) , true ) ;
530
- acc . Logger . Information ( "Not enough resources to build." ) ;
531
+ acc . Logger . Information ( "Not enough resources to build." , this ) ;
531
532
if ( Vill . Settings . UseHeroRes && acc . AccInfo . ServerVersion == ServerVersionEnum . T4_5 ) // Only T4.5 has resources in hero inv
532
533
{
533
534
var heroRes = HeroHelper . GetHeroResources ( acc ) ;
0 commit comments