… | |
… | |
52 | } |
52 | } |
53 | |
53 | |
54 | sub slog { |
54 | sub slog { |
55 | my $level = shift; |
55 | my $level = shift; |
56 | my $format = shift; |
56 | my $format = shift; |
|
|
57 | |
|
|
58 | $format = sprintf $format, @_ if @_; |
|
|
59 | |
57 | my $NOW = (POSIX::strftime "%Y-%m-%d %H:%M:%S", gmtime $::NOW); |
60 | my $NOW = (POSIX::strftime "%Y-%m-%d %H:%M:%S", gmtime $::NOW); |
58 | printf "$NOW: $format\n", @_; |
61 | print "$NOW: $format\n"; |
59 | printf $errorlog "$NOW: $format\n", @_ if $errorlog; |
62 | printf $errorlog "$NOW: $format\n", @_ if $errorlog; |
60 | } |
63 | } |
61 | |
64 | |
62 | our $connections = new Coro::Semaphore $::MAX_CONNECTS || 250; |
65 | our $connections = new Coro::Semaphore $::MAX_CONNECTS || 250; |
63 | our $httpevent = new Coro::Signal; |
66 | our $httpevent = new Coro::Signal; |