<commit_before>from collections import defaultdict
import logbook
from logbook import Logger, NullHandler, RotatingFileHandler, StreamHandler
import logbook.compat
import logging
import os
import sys
from termcolor import colored
import threading

from app.util import autoversioning, fs
from app.util.conf.configuration import Configuration


# This custom format string takes care of setting field widths to make logs more aligned and readable.
_LOG_FORMAT_STRING = (
    '[{record.time!s:.23}] '             # 23 chars of date and time (omits last 3 digits of microseconds)
    '{record.process:6} '
    '{record.level_name:7} '             # log level - min field width = 7
    '{record.thread_name:15.15} '        # thread name - min and max field width = 15
    '{record.channel:15.15} '            # module name - min and max field width = 15
    '{record.message}'
)

# When logging to the console, just print the message
_SIMPLIFIED_LOG_FORMAT_STRING = '{record.message}'

_LOG_COLORS = defaultdict(lambda: ('grey', []), {  # default to grey
    logbook.CRITICAL: ('magenta', ['bold']),
    logbook.ERROR: ('red', ['bold']),
    logbook.WARNING: ('yellow', ['bold']),
    logbook.NOTICE: ('yellow', []),
    logbook.INFO: ('cyan', []),
    logbook.DEBUG: ('green', []),
})

_SIMPLIFIED_LOG_COLORS = defaultdict(lambda: (None, []), {
    logbook.CRITICAL: ('magenta', ['bold']),
    logbook.ERROR: ('red', ['bold']),
    logbook.WARNING: ('yellow', ['bold']),
})


def get_logger(logger_name=None):
    """
    The common pattern for using this method is to create a logger instance in your class constructor:
      >>> self._logger = get_logger(__name__)

    Then use that logger instance anywhere you'd place a print statement. Provide extra arguments directly to the<commit_msg>Add comment for PID log format<commit_after>from collections import defaultdict
import logbook
from logbook import Logger, NullHandler, RotatingFileHandler, StreamHandler
import logbook.compat
import logging
import os
import sys
from termcolor import colored
import threading

from app.util import autoversioning, fs
from app.util.conf.configuration import Configuration


# This custom format string takes care of setting field widths to make logs more aligned and readable.
_LOG_FORMAT_STRING = (
    '[{record.time!s:.23}] '             # 23 chars of date and time (omits last 3 digits of microseconds)
    '{record.process} '                  # pid of process
    '{record.level_name:7} '             # log level - min field width = 7
    '{record.thread_name:15.15} '        # thread name - min and max field width = 15
    '{record.channel:15.15} '            # module name - min and max field width = 15
    '{record.message}'
)

# When logging to the console, just print the message
_SIMPLIFIED_LOG_FORMAT_STRING = '{record.message}'

_LOG_COLORS = defaultdict(lambda: ('grey', []), {  # default to grey
    logbook.CRITICAL: ('magenta', ['bold']),
    logbook.ERROR: ('red', ['bold']),
    logbook.WARNING: ('yellow', ['bold']),
    logbook.NOTICE: ('yellow', []),
    logbook.INFO: ('cyan', []),
    logbook.DEBUG: ('green', []),
})

_SIMPLIFIED_LOG_COLORS = defaultdict(lambda: (None, []), {
    logbook.CRITICAL: ('magenta', ['bold']),
    logbook.ERROR: ('red', ['bold']),
    logbook.WARNING: ('yellow', ['bold']),
})


def get_logger(logger_name=None):
    """
    The common pattern for using this method is to create a logger instance in your class constructor:
      >>> self._logger = get_logger(__name__)

    Then use that logger instance anywhere you'd place a print statement. Provide extra arguments directly to the
{'fraction_non_alphanumeric': 0.12344998622209975, 'fraction_numerical': 0.01074676219344172, 'mean_word_length': 3.720416124837451, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5652318', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1055, 'n_words': 359}