2 Configuration class for P2P logging information.
4 2011, Mariana Marasoiu, mariana.marasoiu@gmail.com
12 # Logging code heavily inspired by Logging HOWTO documentation:
13 # http://docs.python.org/dev/howto/logging.html#configuring-logging
16 # Create logger; default logging level is DEBUG.
17 logger = logging.getLogger(__name__)
18 logger.setLevel(logging.DEBUG)
20 # Create console handler and set level to ERROR.
21 ch = logging.StreamHandler()
22 ch.setLevel(logging.DEBUG)
25 formatter = logging.Formatter('%(filename)s:%(lineno)s - %(levelname)s: %(message)s')
27 # Add formatter to console handler.
28 ch.setFormatter(formatter)
30 # Add console handler to logger.
34 class SwarmConfig(object):
38 def load(self, ini_file):
41 def store(self, ini_file):
44 def add(self, section, option, value):
47 def get(self, section):
50 def set(self, section, option, value):
53 class SessionConfig(object):
57 def load(self, ini_file):
60 def store(self, ini_file):
63 def add(self, section, option, value):
66 def get(self, section):
69 def set(self, section, option, value):
72 class AccessConfig(object):
76 def load(self, ini_file):
79 def store(self, ini_file):
82 def add(self, section, option, value):
85 def get(self, section):
88 def set(self, section, option, value):