<commit_before># ArcPy Logger #
A python module for adding writing log messages to the ArcPy messaging interface.  Super useful for ArcGIS Server GP Services

## Install ##

Use pip to install this utility to your python site-packages.  This will allow you to use it throughout projects!

    pip install git+ssh://<EMAIL>:7999/pyt/arcpylogger.git

## Initialize ##
    import logging
    import ArcPyLogger

    message = 'Example Message'
    warning = 'Example Warning'
    error = 'Example Error'

    log_file = r'example_log_file.txt'

### Use Helper Function ###

    ###
    # Use Helper function
    ###

    # Set logfile and log some sample message types
    ArcPyLogger.setupLogging(log_file)

    logging.info(message)
    logging.warning(warning)
    logging.error(error)

### Use Python Class ###

    logging.basicConfig(level=level)
    # Check if there's already an ArcpyMessageHandler
    rootLogger = logging.getLogger()
    for h in rootLogger.handlers:
        if isinstance(h, ArcPyLogger.ArcpyMessageHandler):
            return

    rootLogger.addHandler(ArcPyLogger.ArcpyMessageHandler())<commit_msg>add better description and add in example w/o log file<commit_after># ArcPy Logger #
ArcPyLogger is a python module that attaches the ArcPy messaging interface to the standard python logging module. 
This gives us the ability to concurrently write a single log message to the ArcGIS for Desktop/Server Console, 
a Log File, and to the Command Line Console. ArcPyLogger makes the development of Python projects more uniform by 
standardizing a single method for communicating back to the client.

## Install ##

Use pip to install this utility to your python site-packages.  This will allow you to use it throughout projects!

    pip install git+ssh://<EMAIL>:7999/pyt/arcpylogger.git

## Initialize ##
    import logging
    import ArcPyLogger

    message = 'Example Message'
    warning = 'Example Warning'
    error = 'Example Error'

    log_file = r'example_log_file.txt'

### Use Helper Function ###

    ###
    # Use Helper function
    ###

    # Set logfile and log some sample message types
    ArcPyLogger.setupLogging()

    logging.info(message)
    logging.warning(warning)
    logging.error(error)
    
### Use Helper Function with Log File ###

    ###
    # Use Helper function
    ###

    # Set logfile and log some sample message types
    ArcPyLogger.setupLogging(log_file)

    logging.info(message)
    logging.warning(warning)
    logging.error(error)

### Use Python Class ###

    logging.basicConfig(level=level)
    # Check if there's already an ArcpyMessageHandler
    rootLogger = logging.getLogger()
    for h in rootLogger.handlers:
        if isinstance(h, ArcPyLogger.ArcpyMessageHandler):
            return

    rootLogger.addHandler(ArcPyLogger.ArcpyMessageHandler())
{'fraction_non_alphanumeric': 0.07838983050847458, 'fraction_numerical': 0.002824858757062147, 'mean_word_length': 3.4474097331240188, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6660106', 'n_tokens_mistral': 793, 'n_tokens_neox': 764, 'n_words': 275}