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

import os
import logging


def init(path=os.path.expanduser('~/.bib.log'), stdout=False):
    LEVEL = logging.DEBUG
    logging.basicConfig(
        filename=path,
        filemode='w',
        format='%(asctime)s - %(levelname)s - %(message)s',
        level=LEVEL
    )
    import sys
    if stdout:
        h = logging.StreamHandler(sys.stdout)
        h.setLevel(LEVEL),
        logging.getLogger().addHandler(h)<commit_msg>log append rather than replace<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import logging


def init(path=os.path.expanduser('~/.bib.log'), stdout=False):
    LEVEL = logging.DEBUG
    logging.basicConfig(
        filename=path,
        filemode='a',
        format='%(asctime)s - %(levelname)s - %(message)s',
        level=LEVEL
    )
    import sys
    if stdout:
        h = logging.StreamHandler(sys.stdout)
        h.setLevel(LEVEL),
        logging.getLogger().addHandler(h)
{'fraction_non_alphanumeric': 0.15245737211634905, 'fraction_numerical': 0.0020060180541624875, 'mean_word_length': 2.6028880866425994, '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': '6366615', 'n_tokens_mistral': 337, 'n_tokens_neox': 323, 'n_words': 59}