Fix timer, make logging less annoying when at Info or higher level. Only show command bonus logspam if there is any.

This commit is contained in:
Ebag333
2017-02-13 13:25:42 -08:00
parent 35e330f574
commit be9eaa0859
5 changed files with 11 additions and 13 deletions

View File

@@ -193,7 +193,7 @@ class Effect(EqBase):
self.__activeByDefault = True
self.__type = None
pyfalog.debug("ImportError or AttributeError generating handler:")
pyfalog.warning(e)
pyfalog.debug(e)
except Exception as e:
pyfalog.critical("Exception generating handler:")
pyfalog.critical(e)

View File

@@ -630,9 +630,7 @@ class Fit(object):
del self.commandBonuses[warfareBuffID]
def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyStorage=None):
# TODO: Validate that remooving this doesn't break anything
# TODO: Keywords: logbook logging Ebag
# timer = Timer(u'Fit: {}, {}'.format(self.ID, self.name), logger)
timer = Timer(u'Fit: {}, {}'.format(self.ID, self.name), pyfalog)
pyfalog.debug("Starting fit calculation on: {0}, withBoosters: {1}", self, withBoosters)
shadow = False
@@ -732,14 +730,14 @@ class Fit(object):
# targetFit.register(item, origin=self)
item.calculateModifiedAttributes(targetFit, runTime, False, True)
print "Command: "
print self.commandBonuses
if len(self.commandBonuses) > 0:
pyfalog.info("Command bonuses applied.")
pyfalog.debug(self.commandBonuses)
if not withBoosters and self.commandBonuses:
self.__runCommandBoosts(runTime)
# TODO: Tied with timer above
# timer.checkpoint('Done with runtime: %s' % runTime)
timer.checkpoint('Done with runtime: %s' % runTime)
# Mark fit as calculated
self.__calculated = True
@@ -750,8 +748,7 @@ class Fit(object):
if fit.getProjectionInfo(self.ID).active:
fit.calculateModifiedAttributes(self, withBoosters=withBoosters, dirtyStorage=dirtyStorage)
# TODO: Tied with timer above
# timer.checkpoint('Done with fit calculation')
timer.checkpoint('Done with fit calculation')
if shadow:
pyfalog.debug("Delete shadow fit object")

View File

@@ -639,7 +639,6 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
effect.handler(fit, self, chargeContext, effect=effect)
except:
effect.handler(fit, self, chargeContext)
pyfalog.debug("Applying effect handler for charge without effect.")
if self.item:
if self.state >= State.OVERHEATED:
@@ -663,7 +662,6 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
effect.handler(fit, self, context, effect=effect)
except:
effect.handler(fit, self, context)
pyfalog.debug("Applying effect handler without effect")
@property
def cycleTime(self):

View File

@@ -1011,7 +1011,7 @@ class Fit(object):
self.recalc(fit)
def recalc(self, fit, withBoosters=True):
pyfalog.debug("=" * 10 + "recalc" + "=" * 10)
pyfalog.info("=" * 10 + "recalc" + "=" * 10)
if fit.factorReload is not self.serviceFittingOptions["useGlobalForceReload"]:
fit.factorReload = self.serviceFittingOptions["useGlobalForceReload"]
fit.clear()

View File

@@ -50,6 +50,7 @@ mktRdy = threading.Event()
class ShipBrowserWorkerThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
pyfalog.debug("Initialize ShipBrowserWorkerThread.")
self.name = "ShipBrowser"
def run(self):
@@ -88,6 +89,7 @@ class PriceWorkerThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.name = "PriceWorker"
pyfalog.debug("Initialize PriceWorkerThread.")
def run(self):
pyfalog.debug("Run start")
@@ -129,6 +131,7 @@ class SearchWorkerThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.name = "SearchWorker"
pyfalog.debug("Initialize SearchWorkerThread.")
def run(self):
self.cv = threading.Condition()