# This is an log configuration file example.
# It can be used for a fined grained selection of what should be logged.
# It must respect the format for python log configuration file: 
# https://docs.python.org/3.5/library/logging.config.html#logging-config-fileformat
#
# loggers qualified name of course depends on pydcop. The most common loggers are 
# given as example in this file.

[loggers]
keys=root,algo,orchestrator,communication,agent, distucs, cli, discovery

[handlers]
keys=handlerout,handlerfile, handlerdiscovery, handlerorchestrator, handleragents, handleralgo, handlerdist

[formatters]
keys=form01

[logger_root]
level=DEBUG
handlers=handlerfile


# Loggers for various DCOP algorithms : MGM, MaxSum, DS, DPOP, etc...
# the loggers for an algorithm should be named 'pydcop.algo.<algo>.<computation>
# With each computation instance having it's own logger.
[logger_algo]
level=INFO
handlers=handleralgo
propagate=0
qualname=pydcop.algo

[logger_cli]
level=DEBUG
handlers=handlerfile
qualname=pydcop.cli


# Logger for replication algorithm
[logger_distucs]
level=DEBUG
handlers=handlerdist
propagate=0
qualname=ucs_replication

[logger_discovery]
level=DEBUG
handlers=handlerdiscovery
propagate=0
qualname=pydcop.discovery


# Logger for agents and orchestrator
[logger_orchestrator]
level=DEBUG
handlers=handlerfile, handlerorchestrator
propagate=0
qualname=pydcop.agent.orchestrator

[logger_agent]
level=DEBUG
handlers=handlerfile, handleragents
propagate=0
qualname=pydcop.agent

# Logger for communication: VERY verbose in debug and info level !
[logger_communication]
level=WARNING
handlers=handlerfile
propagate=0
qualname=infrastructure.communication

[handler_handlerout]
class=StreamHandler
level=NOTSET
formatter=form01
args=(sys.stdout,)

[handler_handlerfile]
class=FileHandler
level=DEBUG
formatter=form01
args=('run.log', 'w')

[handler_handlerdiscovery]
class=FileHandler
level=DEBUG
formatter=form01
args=('discovery.log', 'w')

[handler_handlerorchestrator]
class=FileHandler
level=DEBUG
formatter=form01
args=('orchestrator.log', 'w')

[handler_handleragents]
class=FileHandler
level=DEBUG
formatter=form01
args=('agents.log', 'w')

[handler_handleralgo]
class=FileHandler
level=DEBUG
formatter=form01
args=('algo.log', 'w')

[handler_handlerdist]
class=FileHandler
level=DEBUG
formatter=form01
args=('dist.log', 'w')


[formatter_form01]
# format=F1 %(asctime)s %(levelname)s %(message)s
format=%(asctime)s.%(msecs)03d - %(name)s - %(levelname)s - %(message)s
datefmt=%H:%M:%S
class=logging.Formatter
