Example #1
0
    def __init__(self, sendertype, logger):
        try:
            self.sendertype = sendertype
            self.logger = logger
            self.config = mks.loadSenderConfig(self.sendertype)
            self.mksconfig = mks.loadMkSensorsConfig()

            # Init log
            loglevel = mks.LOGSEVERITY[self.mksconfig.get('loglevel', 'WARNING')]
            mks.init_logging(self.logger, loglevel=loglevel)

        except:
            _LOGGER.exception('SenderPlugin Init error')
            raise
Example #2
0
"""

__authors__ = 'Bruno Adelé <*****@*****.**>'
__copyright__ = 'Copyright (C) 2016 Bruno Adelé'
__description__ = """Tool for easily create sensors daemons"""
__license__ = 'GPL'
__commitnumber__ = "$id$"

import os
import logging

from mksensors.lib import mks
from mksensors.lib.mks.plugins import SenderPlugin

_LOGGER = logging.getLogger(__name__)
mks.init_logging(logger=_LOGGER, loglevel=mks.LOGSEVERITY['DEBUG'])


class Sender(SenderPlugin):
    def __init__(self):
        """Init sender class"""
        try:
            super(Sender, self).__init__('log', _LOGGER)
        except:
            _LOGGER.exception('SenderPlugin Init error')
            raise

        # Init variable
        self._file = None

    def getDescription(self):
Example #3
0
"""

__authors__ = "Bruno Adelé <*****@*****.**>"
__copyright__ = "Copyright (C) 2016 Bruno Adelé"
__description__ = """Tool for easily create sensors daemons"""
__license__ = "GPL"
__commitnumber__ = "$id$"

import os
import logging

from mksensors.lib import mks
from mksensors.lib.mks.plugins import SenderPlugin

_LOGGER = logging.getLogger(__name__)
mks.init_logging(logger=_LOGGER, loglevel=mks.LOGSEVERITY["DEBUG"])


class Sender(SenderPlugin):
    def __init__(self):
        """Init sender class"""
        try:
            super(Sender, self).__init__("log", _LOGGER)
        except:
            _LOGGER.exception("SenderPlugin Init error")
            raise

        # Init variable
        self._file = None

    def getDescription(self):
Example #4
0
 def initSensor(self):
     sensorname = self.sensorname
     logname = 'sensor_%(sensorname)s' % locals()
     loglevel = mks.LOGSEVERITY[self.mksconfig.get('loglevel', 'WARNING')]
     mks.init_logging(self.logger, loglevel=loglevel)