Metadata-Version: 2.1
Name: clogger
Version: 0.12.4
Summary: My way python logger configuration
Home-page: https://github.com/pietrogiuffrida/customlogger/
Author: Pietro Giuffrida
Author-email: pietro.giuffri@gmail.com
License: MIT
Description: #clogger
        
        Python logger configuration, my way.
        
        clogger is a library that helps to configure
        python logging lybrary in the way I like. It
        helps configuration task such:
        
        - multiple handlers (several filehandler, a streamhandler)
        - log level setting for one or all handlers
        
        clogger contains two classes -
        CustomLogger and CustomFormatter -
        based on default logging library.
        
        CustomFormatter inherit and modify
        logging.Formatter class in order to split
        handler names at the last '.', to improve readability
        of the log.
        
        CustomoLogger class initialize and configure logging
        library enabling a small set of preconfigured
        actions.
        
        ## Installation
        
        Install clogger is as easy as run ```pip install clogger```.
        
        ## Usage
        
        You can configure log inside your script with
        few code rows. 
        
        ```python
        from clogger import CustomLogger
        from datetime import datetime
        
        now = datetime.now().strftime('%Y%m%d')
        thisrunlog = 'thisrunlog_{}.log'.format(now)
        
        logger = CustomLogger(
            handler_name="mylog",
            stream_handler=True,
            file_handler=True,
            filenames=["default.log", thisrunlog],
            level="INFO",
        )
        ```
        
        In the above example three handlers
        are defined: one stream handler and two file
        handlers. After definition, the same logger
        can be modified, to hack log level of all
        handlers (of course, the handler must exists
        in the namespace to be varied):
        
        ```python
        # changing log level for all the handlers
        logger.change_level('DEBUG')
        
        # changine level for some handlers
        logger.change_level('DEBUG', ["mylog", "requests"])
        ```
        
        Two methods are definied to be immediately call
        at the start and at the end of a script:
        
        ```python
        logger.starting_message()
        
        #... a lot of code...
        
        logger.exiting_message()
        ```
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
