File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
from mamonsu .lib .plugin import Plugin
3
-
4
3
from mamonsu .lib .const import API
5
4
6
5
from urllib .parse import urlparse as parse
7
6
from urllib .parse import parse_qs
8
7
from http .server import BaseHTTPRequestHandler , HTTPServer
9
-
10
-
11
- # rewrite log_request method of http lib to avoid getting log messages in console
12
- class QuietBaseHTTPRequestHandler (BaseHTTPRequestHandler ):
13
- def log_request (self , code = '-' , size = '-' ):
14
- pass
8
+ import logging
15
9
16
10
17
11
class AgentApi (Plugin ):
@@ -38,11 +32,16 @@ def handler(*args):
38
32
server .serve_forever ()
39
33
40
34
41
- class AgentApiHandler (QuietBaseHTTPRequestHandler ):
35
+ class AgentApiHandler (BaseHTTPRequestHandler ):
42
36
43
37
def __init__ (self , config , * args ):
44
38
self .sender = config .sender
45
- QuietBaseHTTPRequestHandler .__init__ (self , * args )
39
+ self .log = logging .getLogger ('AGENTAPI' )
40
+ BaseHTTPRequestHandler .__init__ (self , * args )
41
+
42
+ # rewrite log_message method of http lib to avoid getting log messages in console
43
+ def log_message (self , format , * args ):
44
+ self .log .info (format , * args )
46
45
47
46
def _set_header (self ):
48
47
self .send_response (200 )
You can’t perform that action at this time.
0 commit comments