<commit_before># -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
import logging


def init_logging(level=logging.DEBUG):
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

    logger = logging.getLogger('enocean')
    logger.setLevel(logging.DEBUG)

    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(formatter)
    logger.addHandler(ch)<commit_msg>logging improvement<commit_after># -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
import logging


def init_logging(level=logging.DEBUG,logsize=1024,logcount=5):
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

    logger = logging.getLogger('enocean')
    logger.setLevel(level)

    stream_handler = logging.StreamHandler()
    stream_handler.setLevel(level)
    logger.addHandler(stream_handler)

    file_handler = RotatingFileHandler('encoean.log', 'a',  logsize*1000 , logcount)
    file_handler.setLevel(level)
    file_handler.setFormatter(formatter)
    logger.addHandler(file_handler)
{'fraction_non_alphanumeric': 0.1294838145231846, 'fraction_numerical': 0.009623797025371828, 'mean_word_length': 4.958333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6403715', 'n_tokens_mistral': 374, 'n_tokens_neox': 351, 'n_words': 59}