Subject: | [patch] Allow more fine grained control of log_level |
I would like to use Starman as optional engine for Test::WWW::WebKit::Catalyst, but by default, it's very
verbose (as can be seen when running Starman's test suite). That's because log_level is hardcoded to 2
or 4 depending on the DEBUG constant.
With the attached patch, Starman supports a new log_level parameter superseding these hardcoded
values while maintaining backwards compatability with the current behaviour if the parameter is not
present.
Subject: | log_level_option.diff |
diff --git a/lib/Starman/Server.pm b/lib/Starman/Server.pm
index b9f6b08..c154cde 100644
--- a/lib/Starman/Server.pm
+++ b/lib/Starman/Server.pm
@@ -69,7 +69,7 @@ sub run {
host => $host,
proto => $proto,
serialize => 'flock',
- log_level => DEBUG ? 4 : 2,
+ log_level => $options->{log_level} // (DEBUG ? 4 : 2),
($options->{error_log} ? ( log_file => $options->{error_log} ) : () ),
min_servers => $options->{min_servers} || $workers,
min_spare_servers => $options->{min_spare_servers} || $workers - 1,