# Path: duct/objects.py
# class Output(object):
#     """Output parent class
# 
#     Outputs can inherit this object which provides a construct
#     for a working output
# 
#     :param config: Dictionary config for this queue (usually read from the
#              yaml configuration)
#     :param duct: A DuctService object for interacting with the queue manager
#     """
#     def __init__(self, config, duct):
#         self.config = config
#         self.duct = duct
#         self.events = []
#         self.maxsize = 0
# 
#     def createClient(self):
#         """Deferred which sets up the output
#         """
#         pass
# 
#     def eventsReceived(self, events):
#         """Receives a list of events and queues them
# 
#         Arguments:
#         events -- list of `duct.objects.Event`
#         """
#         # Make sure queue isn't oversized
#         if self.maxsize > 0:
#             if (self.maxsize < 1) or (len(self.events) < self.maxsize):
#                 self.events.extend(events)
#         else:
#             self.events.extend(events)
# 
#     def stop(self):
#         """Called when the service shuts down
#         """
#         pass


from twisted.python import log
from duct.objects import Output
"""
.. module:: logger
   :synopsis: Output which sends events to the standard logging output

.. moduleauthor:: Colin Alston <colin@imcol.in>
"""



class Logger(Output):
    """Logger output

    **Configuration arguments:**

    :param logfile: Logfile (default: Write to standard log)
    :type logfile: str
    """
    def __init__(self, *a, **kw):

# Path: duct/objects.py
# class Output(object):
#     """Output parent class
# 
#     Outputs can inherit this object which provides a construct
#     for a working output
# 
#     :param config: Dictionary config for this queue (usually read from the
#              yaml configuration)
#     :param duct: A DuctService object for interacting with the queue manager
#     """
#     def __init__(self, config, duct):
#         self.config = config
#         self.duct = duct
#         self.events = []
#         self.maxsize = 0
# 
#     def createClient(self):
#         """Deferred which sets up the output
#         """
#         pass
# 
#     def eventsReceived(self, events):
#         """Receives a list of events and queues them
# 
#         Arguments:
#         events -- list of `duct.objects.Event`
#         """
#         # Make sure queue isn't oversized
#         if self.maxsize > 0:
#             if (self.maxsize < 1) or (len(self.events) < self.maxsize):
#                 self.events.extend(events)
#         else:
#             self.events.extend(events)
# 
#     def stop(self):
#         """Called when the service shuts down
#         """
#         pass


# Path: duct/outputs/logger.py
from twisted.python import log
from duct.objects import Output

"""
.. module:: logger
   :synopsis: Output which sends events to the standard logging output

.. moduleauthor:: Colin Alston <colin@imcol.in>
"""



class Logger(Output):
    """Logger output

    **Configuration arguments:**

    :param logfile: Logfile (default: Write to standard log)
    :type logfile: str
    """
    def __init__(self, *a, **kw):

        Output.__init__(self, *a, **kw)