<commit_before>import os
from app import app
import argparse

def parse_args():
    parser = argparse.ArgumentParser(description="MEMEX EXPLORER")

    parser.add_argument("-s", "--show", action="store_true",
                        help="Auto-raise app in a browser window")

    return parser.parse_args()

app.config.from_pyfile('config.py')

if __name__ == "__main__":
    args = parse_args()


    if args.show:
        url = "http://%s:%s/" % (app.config['HOST'], app.config['PORT'])
        if app.config['DEBUG']:
            print url
        else:
            import webbrowser
            webbrowser.open(url)

    app.run(host=app.config['HOST'], port=app.config['PORT'], debug=app.config['DEBUG'])
<commit_msg>Add basic logging<commit_after>import os
from app import app
import argparse

def parse_args():
    parser = argparse.ArgumentParser(description="MEMEX EXPLORER")

    parser.add_argument("-s", "--show", action="store_true",
                        help="Auto-raise app in a browser window")

    return parser.parse_args()

app.config.from_pyfile('config.py')

if __name__ == "__main__":
    args = parse_args()


    if args.show:
        url = "http://%s:%s/" % (app.config['HOST'], app.config['PORT'])
        if app.config['DEBUG']:
            print url
        else:
            import webbrowser
            webbrowser.open(url)

    if not app.debug:
        import logging
        file_handler = logging.FileHandler('memex_explorer.log')
        file_handler.setLevel(logging.WARNING)
        app.logger.addHandler(file_handler)

    app.run(host=app.config['HOST'], port=app.config['PORT'], debug=app.config['DEBUG'])

{'fraction_non_alphanumeric': 0.14346246973365617, 'fraction_numerical': 0.0, 'mean_word_length': 2.782608695652174, 'pattern_counts': {'":': 2, '<': 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': '6994173', 'n_tokens_mistral': 511, 'n_tokens_neox': 497, 'n_words': 105}