<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Brewery handy utilities"""

import re
import logging

logger_name = 'brewery'
logger = None

def get_logger():
    """Get brewery default logger"""
    if logger:
        return logger
    else:
        return create_logger()
        
def create_logger():
    """Create a default logger"""
    logger = logging.getLogger(logger_name)

    formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')
    
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    
    return logger<commit_msg>fix: logger is global<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Brewery handy utilities"""

import re
import logging

logger_name = 'brewery'
logger = None

def get_logger():
    """Get brewery default logger"""
    global logger
    
    if logger:
        return logger
    else:
        return create_logger()
        
def create_logger():
    """Create a default logger"""
    global logger
    logger = logging.getLogger(logger_name)

    formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')
    
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    
    return logger
{'fraction_non_alphanumeric': 0.12277992277992278, 'fraction_numerical': 0.0015444015444015444, 'mean_word_length': 3.1405750798722045, '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': '4178067', 'n_tokens_mistral': 393, 'n_tokens_neox': 378, 'n_words': 98}