Code review comment for lp:~javier.collado/utah/battery-measurements-logging

Revision history for this message
Andy Doan (doanac) wrote :

Here's my concern (and I'm not sure if its worth considering):

If someone ever did something innocent like add a "logging.info" to _Battery.__init__, then this bug will come back. It seems like the real bug is at the end of the file:

  battery = _Battery()

I wonder if we should change that to be something like:

_inst = None
def get_battery():
   if not inst:
      _inst = _Battery()
    return _inst

then you'd have to refactor who uses this, so maybe its overkill

« Back to merge proposal