@cryptotaxi247 / netdata-1 / commits / 075b30666

fix better logging

paulfantom committed Jul 15, 2016 at 16:07 UTC 075b30666ccd8f56fe4f9a24fd744a5fbb37d4d4
1 file changed +10 -10
plugins.d/python.d.plugin
+10 -10
@@ -321,15 +321,15 @@ class PythonCharts(object):
321 """
322 i = 0
323 overridden = []
324 - self.debug("all job objects:", str(self.jobs))
324 + msg.debug("all job objects", str(self.jobs))
325 while i < len(self.jobs):
326 job = self.jobs[i]
327 try:
328 if not job.check():
329 - self.error("check function failed.")
329 + msg.error(job.chart_name, "check function failed.")
330 self._stop(job)
331 else:
332 - msg.debug(job.chart_name, ": check succeeded")
332 + msg.debug(job.chart_name, "check succeeded")
333 i += 1
334 try:
335 if job.override_name is not None:
@@ -347,12 +347,12 @@ class PythonCharts(object):
347 pass
348 except AttributeError:
349 self._stop(job)
350 - self.error("cannot find check() function.")
350 + msg.error(job.chart_name, "cannot find check() function.")
351 except (UnboundLocalError, Exception) as e:
352 - self.error(str(e))
352 + msg.error(job.chart_name, str(e))
353 self._stop(job)
354 - self.debug("overridden job names:", str(overridden))
355 - self.debug("all remaining job objects:", str(self.jobs))
354 + msg.debug("overridden job names:", str(overridden))
355 + msg.debug("all remaining job objects:", str(self.jobs))
356
357 def create(self):
358 """
@@ -366,7 +366,7 @@ class PythonCharts(object):
366 job = self.jobs[i]
367 try:
368 if not job.create():
369 - self.error("create function failed.")
369 + msg.error(job.chart_name, "create function failed.")
370 self._stop(job)
371 else:
372 chart = job.chart_name
@@ -383,10 +383,10 @@ class PythonCharts(object):
383 # sys.stdout.flush()
384 i += 1
385 except AttributeError:
386 - self.error("cannot find create() function.")
386 + msg.error(job.chart_name, "cannot find create() function.")
387 self._stop(job)
388 except (UnboundLocalError, Exception) as e:
389 - self.error(str(e))
389 + msg.error(job.chart_name, str(e))
390 self._stop(job)
391
392 def update(self):