Skip to content

Commit 8ce1816

Browse files
author
Juliya Smith
committed
Add docstring for get_logger
1 parent 8dc1405 commit 8ce1816

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

c42seceventcli/common/util.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ class DestinationArgs(object):
7373

7474

7575
def get_logger(formatter, service_name, destination_args):
76+
"""Args:
77+
formatter: The formatter for logger.
78+
service_name: The name of the script getting the logger.
79+
Necessary for distinguishing multiple loggers.
80+
destination_args: DTO holding the destination_type, destination, destination_port, and destination_protocol.
81+
Returns:
82+
A logger with the correct handler per destination_type.
83+
For destination_type == stdout, it uses a StreamHandler.
84+
For destination_type == file, it uses a FileHandler.
85+
For destination_type == server, it uses a NoPrioritySyslogHandler.
86+
"""
87+
7688
logger = logging.getLogger("{0}_logger".format(service_name))
7789
handler = _get_log_handler(destination_args)
7890
handler.setFormatter(formatter)

0 commit comments

Comments
 (0)