def __init__(self, type):
        self.lines = {}
        logger = Logger(__name__)

        files = glob.glob("data/" + type.upper() + "/*")

        for file in files:
            logger.debug("Loading JIRA: " + file)
            self.lines[file] = []
            with open(file, 'r') as f:
                lines = []
                for line in f:
                    if line.find('Caused by') >= 0 or line.find('ERROR') >= 0:
                        lines.append(line.strip())

                self.lines[file] = lines
                logger.debug("JIRA: %s loaded with %s lines", file, str(len(lines)))
Exemple #2
0
from lib.toolkit import load_properties
# Start-up Kernel
kernel = Kernel(load_properties("conf/os.properties"))
log = kernel.logger

# ----------------------------------------------------------------------------------------------------------------------
# Logger
# ----------------------------------------------------------------------------------------------------------------------
import gc
from lib.Logger import Logger

log = Logger()

log.info("Hello!")
log.error("Critical Issue!!")
log.debug("Free memory: " + str(gc.free_mem()))

# ----------------------------------------------------------------------------------------------------------------------
# Update DuckDNS
# ----------------------------------------------------------------------------------------------------------------------
from lib.toolkit import update_duck_dns

# Update DuckDNS service
update_duck_dns("mydomain", "mytoken", "192.168.0.10")

# ----------------------------------------------------------------------------------------------------------------------
#
# NodeMCU Examples
#
# ----------------------------------------------------------------------------------------------------------------------
from hw.NodeMCU import NodeMCU
from lib.Kernel import Kernel
from lib.toolkit import load_properties, determine_preferred_wifi
# Start-up Kernel
kernel = Kernel(load_properties("conf/os.properties"))
log = kernel.logger

# ----------------------------------------------------------------------------------------------------------------------
# Logger
# ----------------------------------------------------------------------------------------------------------------------
import gc
from lib.Logger import Logger
log = Logger("DEBUG")

log.info("Hello!")
log.error("Critical Issue!!")
log.debug("Free memory: " + str(gc.mem_free()))

# ----------------------------------------------------------------------------------------------------------------------
# Update DuckDNS
# ----------------------------------------------------------------------------------------------------------------------
from lib.toolkit import update_duck_dns

# Update DuckDNS service
update_duck_dns("mydomain", "mytoken", "myip")

# ----------------------------------------------------------------------------------------------------------------------
#
# NodeMCU Examples
#
# ----------------------------------------------------------------------------------------------------------------------
from hw.board.NodeMCU import NodeMCU