Browse Source

log configured AlfredParser/BatmanParser/DashingClient/GraphitePush

Helge Jung 9 years ago
parent
commit
4571495850
5 changed files with 19 additions and 0 deletions
  1. 5 0
      batcave.py
  2. 3 0
      ffstatus/alfred.py
  3. 3 0
      ffstatus/batman.py
  4. 3 0
      ffstatus/dashing.py
  5. 5 0
      ffstatus/graphite.py

+ 5 - 0
batcave.py

@@ -57,6 +57,11 @@ if args.no_send:
 if not args.alfred_json is None: a.alfred_json = args.alfred_json
 if not args.batadv_vis is None: b.batadv_vis = args.batadv_vis
 
+logger.debug('Configured A.L.F.R.E.D. source: ' + str(a))
+logger.debug('Configured B.A.T.M.A.N. source: ' + str(b))
+logger.debug('Configured Dashing: ' + str(d))
+logger.debug('Configured Graphite: ' + str(g))
+
 for i in [ ('AlfredParser', a), ('BatmanParser', b) ]:
 	try:
 		i[1].sanitycheck()

+ 3 - 0
ffstatus/alfred.py

@@ -13,6 +13,9 @@ class AlfredParser:
 	alfred_json = 'alfred-json'
 	alfred_datatypes = [ ('static', 158), ('dynamic', 159) ]
 
+	def __str__(self):
+		return 'AlfredParser \'{0}\' {1}'.format(self.alfred_json, str.join(' ', [ '{1}=>{0}'.format(x[0], x[1]) for x in self.alfred_datatypes ]))
+
 	def sanitycheck(self):
 		testdata = None
 		try:

+ 3 - 0
ffstatus/batman.py

@@ -15,6 +15,9 @@ class BatmanParser:
 	batadv_vis = 'batadv-vis'
 	mactranslation = string.maketrans('2367abef', '014589cd')
 
+	def __str__(self):
+		return 'BatmanParser \'{0}\''.format(self.batadv_vis)
+
 	def sanitycheck(self):
 		testdata = None
 		try:

+ 3 - 0
ffstatus/dashing.py

@@ -12,6 +12,9 @@ class DashingClient:
 		self.auth_token = auth_token
 		self.logger = logging.getLogger('dashing')
 
+	def __str__(self):
+		return 'Dashing at \'{0}\''.format(self.base_url)
+
 	def send(self, metric, current, previous=None):
 		info = {
 			'auth_token': self.auth_token,

+ 5 - 0
ffstatus/graphite.py

@@ -18,6 +18,11 @@ class GraphitePush:
 		self.target_host = host
 		self.target_port = port
 
+	def __str__(self):
+		return 'Graphite at [{0}]:{1} (prefix=\'{2}\', whitelist={3})'.format(
+			self.target_host, self.target_port,
+			self.prefix, self.whitelist)
+
 	def push(self, data, ts=None):
 		if ts is None: ts = time.time()
 		ts = int(ts)