# #
###############################################################################
+import logging
+
+from . import logger
+
+# Setup logging
+log = logging.getLogger("bricklayer")
+
class Bricklayer(object):
"""
Bricklayer's base class
"""
- def __init__(self):
- pass
+ def __init__(self, test=False, debug=False):
+ # Enable debug logging
+ if debug:
+ log.setLevel(logging.DEBUG)
+
+ log.info("Bricklayer initialized")
def __call__(self):
pass
--- /dev/null
+###############################################################################
+# #
+# Bricklayer - An Installer for IPFire #
+# Copyright (C) 2021 IPFire Development Team #
+# #
+# This program is free software; you can redistribute it and/or #
+# modify it under the terms of the GNU General Public License #
+# as published by the Free Software Foundation; either version 2 #
+# of the License, or (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+import logging
+import logging.handlers
+
+# Initialise root logger
+log = logging.getLogger("bricklayer")
+log.setLevel(logging.INFO)
+
+# Always log everything to syslog
+handler = logging.handlers.SysLogHandler(address="/dev/log",
+ facility=logging.handlers.SysLogHandler.LOG_DAEMON)
+handler.setLevel(logging.DEBUG)
+log.addHandler(handler)