<commit_before>#!/usr/bin/env python
"""
This file illustrates the cross language polymorphism using SWIG directors.
"""
import example


class PyLogger(example.Logger):

    def __init__(self):
        example.Logger.__init__(self)

    def log(self, level, message):
        print("Python Logger - Level {}  message: {}".format(level, message))

# Create an instance of the C++ Log class, which has a pointer to a C++ Logger class within it
log = example.Log()

# Add a simple C++ Logger (log owns the Logger, so we disown it first by clearing the .thisown flag).
print("Adding and calling a normal C++ Logger")
print("--------------------------------------")
logger = example.Logger()<commit_msg>Changed Python Logger derived class to use logging module<commit_after>#!/usr/bin/env python
"""
This file illustrates the cross language polymorphism using SWIG directors.
"""
import logging

import example


class PyLogger(example.Logger):

    def __init__(self):
        example.Logger.__init__(self)

        # Configure Python logging module root logger
        logging.basicConfig(format='%(asctime)s  %(levelname)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p',
                            level=logging.INFO)

    def log(self, level, message):
        logging.log(level, message)

# Create an instance of the C++ Log class, which has a pointer to a C++ Logger class within it
log = example.Log()

# Add a simple C++ Logger (log owns the Logger, so we disown it first by clearing the .thisown flag).
print("Adding and calling a normal C++ Logger")
print("--------------------------------------")
logger = example.Logger()
{'fraction_non_alphanumeric': 0.15653775322283608, 'fraction_numerical': 0.0, 'mean_word_length': 3.0346534653465347, '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': '5864100', 'n_tokens_mistral': 448, 'n_tokens_neox': 427, 'n_words': 176}