<commit_before># Copyright 2017 IBM Corp.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


import logging
from config import CONF


class Logger():
    def __init__(self, logger, path="/var/log/nova/zvmsdk.log",
                    Clevel=logging.DEBUG, Flevel = logging.DEBUG):
        # create a logger
        self.logger = logging.getLogger(logger)
        self.logger.setLevel(logging.INFO)

        # create a handler for the file
        fh = logging.FileHandler(path)
        fh.setLevel(Flevel)

        # create a hander for the console
        ch = logging.StreamHandler()
        ch.setLevel(logging.ERROR)

        # set the formate of the handler
        formatter = logging.Formatter(
            '[%(asctime)s] [%(levelname)s] %(message)s', '%Y-%m-%d %H:%M:%S')
        fh.setFormatter(formatter)
        ch.setFormatter(formatter)

        # add handler in the logger
        self.logger.addHandler(fh)
        self.logger.addHandler(ch)

    def getlog(self):
        return self.logger


log_level = CONF.logging.log_level
if log_level is "logging.INFO" or "logging.info":
    log_level = logging.INFO
elif log_level is "logging.DEBUG" or "logging.debug":
    log_level = logging.DEBUG
elif log_level is "logging.WARN" or "logging.warn":
    log_level = logging.WARN
elif log_level is "logging.ERROR" or "logging.error":
    log_level = logging.ERROR
elif log_level is "logging.CRITICAL" or "logging.critical":
    log_level = logging.CRITICAL
<commit_msg>disable stream log handler<commit_after># Copyright 2017 IBM Corp.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


import logging
from config import CONF


class Logger():
    def __init__(self, logger, path="/var/log/nova/zvmsdk.log",
                    Clevel=logging.DEBUG, Flevel = logging.DEBUG):
        # create a logger
        self.logger = logging.getLogger(logger)
        self.logger.setLevel(logging.INFO)

        # create a handler for the file
        fh = logging.FileHandler(path)
        fh.setLevel(Flevel)

        # set the formate of the handler
        formatter = logging.Formatter(
            '[%(asctime)s] [%(levelname)s] %(message)s', '%Y-%m-%d %H:%M:%S')
        fh.setFormatter(formatter)

        # add handler in the logger
        self.logger.addHandler(fh)

    def getlog(self):
        return self.logger


log_level = CONF.logging.log_level
if log_level is "logging.INFO" or "logging.info":
    log_level = logging.INFO
elif log_level is "logging.DEBUG" or "logging.debug":
    log_level = logging.DEBUG
elif log_level is "logging.WARN" or "logging.warn":
    log_level = logging.WARN
elif log_level is "logging.ERROR" or "logging.error":
    log_level = logging.ERROR
elif log_level is "logging.CRITICAL" or "logging.critical":
    log_level = logging.CRITICAL

{'fraction_non_alphanumeric': 0.09551148225469729, 'fraction_numerical': 0.0041753653444676405, 'mean_word_length': 2.9434156378600824, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6908149', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1095, 'n_words': 372}