49
49
# Modules included in our package.
50
50
from coloredlogs .converter import capture , convert
51
51
from coloredlogs .demo import demonstrate_colored_logging
52
+ from coloredlogs .demo import demonstrate_colored_logging_with_different_formatters
52
53
53
54
# Initialize a logger for this module.
54
55
logger = logging .getLogger (__name__ )
@@ -60,7 +61,7 @@ def main():
60
61
try :
61
62
# Parse the command line arguments.
62
63
options , arguments = getopt .getopt (sys .argv [1 :], 'cdh' , [
63
- 'convert' , 'to-html' , 'demo' , 'help' ,
64
+ 'convert' , 'to-html' , 'demo' , 'demo-with-formatter' , ' help' ,
64
65
])
65
66
# Map command line options to actions.
66
67
for option , value in options :
@@ -69,6 +70,8 @@ def main():
69
70
arguments = []
70
71
elif option in ('-d' , '--demo' ):
71
72
actions .append (demonstrate_colored_logging )
73
+ elif option in ('-f' , '--demo-with-formatter' ):
74
+ actions .append (demonstrate_colored_logging_with_different_formatters )
72
75
elif option in ('-h' , '--help' ):
73
76
usage (__doc__ )
74
77
return
0 commit comments