commit fd5bab1cab88caa9f47697c941f8e2fe28573a01
Author: Marc Dequènes (Duck) <Duck@DuckCorp.org>
Date:   Sun Apr 4 16:48:54 2010 +0200

    [cleanup] moved base require files in 'lib/cyborghood/base'

diff --git a/.gitignore b/.gitignore
index 99e056d..0e1ad87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@
 \#*#
 # generated by installer
 .config
-lib/cyborghood/config_setup.rb
+lib/cyborghood/base/config_setup.rb
 data/locale
 #
 conf
diff --git a/Rakefile b/Rakefile
index 8d068e3..8b03174 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,8 +5,8 @@ ENV['LC_ALL'] = "C"
 
 require 'rake'
 require 'gettext/utils'
-require 'lib/cyborghood/config_setup'
-require 'lib/cyborghood/info'
+require 'lib/cyborghood/base/config_setup'
+require 'lib/cyborghood/base/info'
 
 namespace :i18n do
 desc "Create mo-files for l10n"
diff --git a/lib/cyborghood.rb b/lib/cyborghood.rb
index ea0c71b..1705bd5 100644
--- a/lib/cyborghood.rb
+++ b/lib/cyborghood.rb
@@ -18,12 +18,12 @@
 
 $KCODE = 'UTF8'
 require 'jcode'
-require "cyborghood/config"
-require "cyborghood/info"
-require "cyborghood/lang_additions"
-require 'cyborghood/logger'
-require 'cyborghood/language'
-require 'cyborghood/exceptions'
+require 'cyborghood/base/config'
+require 'cyborghood/base/info'
+require 'cyborghood/base/lang_additions'
+require 'cyborghood/base/logger'
+require 'cyborghood/base/language'
+require 'cyborghood/base/exceptions'
 
 module CyborgHood
   include I18nTranslation
diff --git a/lib/cyborghood/base/config.rb b/lib/cyborghood/base/config.rb
new file mode 100644
index 0000000..2fd3c38
--- /dev/null
+++ b/lib/cyborghood/base/config.rb
@@ -0,0 +1,80 @@
+#--
+# CyborgHood, a distributed system management software.
+# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
+#
+# 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 3 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/>.
+#++
+
+require 'singleton'
+require 'yaml'
+require 'cyborghood/base/config_setup'
+
+module CyborgHood
+  class Config
+    include Singleton
+
+    CONFFILE_GLOBAL = "cyborghood.conf"
+    CONFFILE_BOT = "cyborghood_%s.conf"
+
+    def self.load(name = nil)
+      # load all config parts
+      config = fetch_config
+      unless name.nil?
+        config_spc = fetch_config(name)
+        config = merge_configs(config, config_spc) if config_spc
+      end
+
+      # create config object for easier access
+      @@config = config.to_ostruct.freeze
+    end
+
+    def method_missing(sym, *args, &block)
+      begin
+        @@config.send sym, *args, &block
+      rescue
+        nil
+      end
+    end
+
+    private
+
+    def self.fetch_config(name = nil)
+      begin
+        if name.nil?
+          filename = CONFFILE_GLOBAL
+        else
+          filename = sprintf(CONFFILE_BOT, name)
+        end
+        filepath = File.join(File.expand_path(CFG_DIR), filename)
+        str = File.read(filepath)
+        YAML.load(str)
+      rescue
+        logger.fatal "Problems fetching configuration file '" + filepath + "': " + $!
+        exit 1
+      end
+    end
+
+    def self.merge_configs(conf1, conf2)
+      new_conf = conf1.dup
+      conf2.each_pair do |k, v|
+        if conf1.has_key?(k) and conf1[k].is_a?(Hash) and v.is_a?(Hash)
+          new_conf[k] = merge_configs(conf1[k], v)
+        else
+          new_conf[k] = v
+        end
+      end
+      return new_conf
+    end
+  end
+end
diff --git a/lib/cyborghood/base/exceptions.rb b/lib/cyborghood/base/exceptions.rb
new file mode 100644
index 0000000..fefe96c
--- /dev/null
+++ b/lib/cyborghood/base/exceptions.rb
@@ -0,0 +1,41 @@
+#--
+# CyborgHood, a distributed system management software.
+# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
+#
+# 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 3 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/>.
+#++
+
+module CyborgHood
+  # severities: :grave :unrecoverable :processable :ignorable
+  # categories:
+  #  - db (not a protocol?)
+  #    + ldap
+  #    + sql
+  #  - protocol
+  #    + imap
+  #    + mail
+  #  - service
+  #    + dns
+  class CyberError < StandardError
+    attr_accessor :severity, :category
+
+    #include GetTextSupport
+
+    def initialize(severity, category, message)
+      @severity = severity
+      @category = category
+      super(message)
+    end
+  end
+end
diff --git a/lib/cyborghood/base/info.rb b/lib/cyborghood/base/info.rb
new file mode 100644
index 0000000..45d53df
--- /dev/null
+++ b/lib/cyborghood/base/info.rb
@@ -0,0 +1,4 @@
+module CyborgHood
+  PRODUCT = "CyborgHood"
+  VERSION = "0.2.0~dev"
+end
diff --git a/lib/cyborghood/base/lang_additions.rb b/lib/cyborghood/base/lang_additions.rb
new file mode 100644
index 0000000..efbff3b
--- /dev/null
+++ b/lib/cyborghood/base/lang_additions.rb
@@ -0,0 +1,63 @@
+#--
+# CyborgHood, a distributed system management software.
+# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
+#
+# 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 3 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/>.
+#++
+
+require 'ostruct'
+
+class Hash
+  def to_ostruct
+    data = self.dup
+    data.each_pair do |k, v|
+      data[k] = v.to_ostruct if v.is_a?(Hash)
+    end
+    OpenStruct.new(data)
+  end
+end
+
+class Object
+  def logger
+    CyborgHood::Logger.instance
+  end
+
+  def self.human_name
+    self.name.split("::").last
+  end
+  def human_name
+    self.class.human_name
+  end
+end
+
+# WARNING: the TMail send_to() method is _unsuable_, even with the following fixes
+require 'tmail'
+module TMail
+  class Mail
+    # fix method using obsoleted from_address() method
+    def do_send_to( smtp )
+      from = from_addrs or raise ArgumentError, 'no from address'
+      (dests = destinations).empty? and raise ArgumentError, 'no receipient'
+      yield
+      send_to_0 smtp, from, dests
+    end
+
+    # fix method using encoded() with a wrong number of args
+    def send_to_0( smtp, from, to )
+      smtp.ready(from, to) do |f|
+        encoded "\r\n", 'j', f
+      end
+    end
+  end
+end
diff --git a/lib/cyborghood/base/language.rb b/lib/cyborghood/base/language.rb
new file mode 100644
index 0000000..36375bd
--- /dev/null
+++ b/lib/cyborghood/base/language.rb
@@ -0,0 +1,122 @@
+#--
+# CyborgHood, a distributed system management software.
+# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
+#
+# 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 3 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/>.
+#++
+
+require 'singleton'
+require 'gettext'
+
+
+module CyborgHood
+  class I18nController
+    include Singleton
+    include GetText
+
+    def initialize
+      @config = Config.instance
+    end
+
+    def available_languages
+      list = ['en'] + Dir.new(Config::L10N_DIR).select{|d| File.directory?(File.join(Config::L10N_DIR, d)) and d[0..0] != "." }
+      # local admin can restrict available languages
+      # (may be useful if l10n is partial due to third party plugins)
+      list = list & @config.i18n.restricted_language_set if @config.i18n.restricted_language_set
+      list = ['en'] if list.empty?
+      list
+    end
+
+    def set_language(lang)
+      set_locale_all(lang)
+    end
+
+    def set_default_language
+      set_language('en')
+    end
+
+    def set_language_for_user(user)
+      if user.nil?
+        set_default_language
+      else
+        logger.debug "User preference for language: " + user.preferredLanguage
+
+        lang = user.prefered_language(self.available_languages)
+        if lang.nil?
+          logger.debug "No available language fits the user preference, using english"
+          lang = 'en'
+        else
+          logger.debug "Language better fitting user preference: " + lang
+        end
+
+        set_language(lang)
+      end
+    end
+  end
+
+  class I18nMessage
+    attr_reader :translated, :untranslated, :parts
+
+    def initialize(translated, untranslated, parts)
+      @translated = translated % parts
+      @untranslated = untranslated % parts
+      @parts = parts
+    end
+
+    def to_s
+      @translated
+    end
+  end
+
+  module I18nTranslation
+    def self.included(base)
+      base.class_eval("include GetText")
+
+      # translation methods needs to be available at class level too
+      base.extend(self)
+    end
+    include GetText
+
+    alias :_orig :_
+    def _(message, parts = {})
+      create_tm(:_orig, message, parts)
+    end
+
+    alias :n_orig :n_
+    def n_(message, parts = {})
+      create_tm(:n_orig, message, parts)
+    end
+
+    alias :s_orig :s_
+    def s_(message, parts = {})
+      create_tm(:s_orig, message, parts)
+    end
+
+    alias :ns_orig :ns_
+    def ns_(message, parts = {})
+      create_tm(:ns_orig, message, parts)
+    end
+
+    alias :np_orig :np_
+    def np_(message, parts = {})
+      create_tm(:np_orig, message, parts)
+    end
+
+    def create_tm(method, message, parts)
+      I18nMessage.new(self.send(method, message), message, parts)
+    end
+
+    module_function :_, :n_, :s_, :ns_, :np_
+  end
+end
diff --git a/lib/cyborghood/base/logger.rb b/lib/cyborghood/base/logger.rb
new file mode 100644
index 0000000..85a0985
--- /dev/null
+++ b/lib/cyborghood/base/logger.rb
@@ -0,0 +1,66 @@
+#--
+# CyborgHood, a distributed system management software.
+# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
+#
+# 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 3 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/>.
+#++
+
+require 'singleton'
+require 'log4r'
+
+module CyborgHood
+  class Logger < Log4r::Logger
+    include Singleton
+
+    LOG_FORMAT = "[%5l - %d] #PREFIX#%m"
+
+    def output_level(level)
+      l = case level
+      when :verbose
+        Log4r::DEBUG
+      when :quiet
+        Log4r::FATAL
+      else # normal
+        Log4r::WARN
+      end
+      @main_outputter.level = l
+    end
+
+    def log_to_file(filename)
+      file_outputter = Log4r::FileOutputter.new(filename, :filename => filename)
+      file_outputter.formatter = @default_formatter
+      self.outputters << file_outputter
+    end
+
+    def set_prefix(prefix = "")
+      prefix ||= ""
+      log_format = LOG_FORMAT.gsub("#PREFIX#", prefix)
+      @default_formatter = Log4r::PatternFormatter.new(:pattern => log_format)
+      self.outputters.each{|outputter| outputter.formatter = @default_formatter }
+    end
+
+    private
+
+    def initialize
+      super(PRODUCT)
+
+      self.level = Log4r::DEBUG
+      @main_outputter = Log4r::Outputter.stdout
+      @main_outputter.level = Log4r::WARN
+      self.outputters = [@main_outputter]
+
+      set_prefix()
+    end
+  end
+end
diff --git a/lib/cyborghood/config.rb b/lib/cyborghood/config.rb
deleted file mode 100644
index a87c417..0000000
--- a/lib/cyborghood/config.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-#--
-# CyborgHood, a distributed system management software.
-# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
-#
-# 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 3 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/>.
-#++
-
-require 'singleton'
-require 'yaml'
-require "cyborghood/config_setup"
-
-module CyborgHood
-  class Config
-    include Singleton
-
-    CONFFILE_GLOBAL = "cyborghood.conf"
-    CONFFILE_BOT = "cyborghood_%s.conf"
-
-    def self.load(name = nil)
-      # load all config parts
-      config = fetch_config
-      unless name.nil?
-        config_spc = fetch_config(name)
-        config = merge_configs(config, config_spc) if config_spc
-      end
-
-      # create config object for easier access
-      @@config = config.to_ostruct.freeze
-    end
-
-    def method_missing(sym, *args, &block)
-      begin
-        @@config.send sym, *args, &block
-      rescue
-        nil
-      end
-    end
-
-    private
-
-    def self.fetch_config(name = nil)
-      begin
-        if name.nil?
-          filename = CONFFILE_GLOBAL
-        else
-          filename = sprintf(CONFFILE_BOT, name)
-        end
-        filepath = File.join(File.expand_path(CFG_DIR), filename)
-        str = File.read(filepath)
-        YAML.load(str)
-      rescue
-        logger.fatal "Problems fetching configuration file '" + filepath + "': " + $!
-        exit 1
-      end
-    end
-
-    def self.merge_configs(conf1, conf2)
-      new_conf = conf1.dup
-      conf2.each_pair do |k, v|
-        if conf1.has_key?(k) and conf1[k].is_a?(Hash) and v.is_a?(Hash)
-          new_conf[k] = merge_configs(conf1[k], v)
-        else
-          new_conf[k] = v
-        end
-      end
-      return new_conf
-    end
-  end
-end
diff --git a/lib/cyborghood/exceptions.rb b/lib/cyborghood/exceptions.rb
deleted file mode 100644
index fefe96c..0000000
--- a/lib/cyborghood/exceptions.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# CyborgHood, a distributed system management software.
-# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
-#
-# 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 3 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/>.
-#++
-
-module CyborgHood
-  # severities: :grave :unrecoverable :processable :ignorable
-  # categories:
-  #  - db (not a protocol?)
-  #    + ldap
-  #    + sql
-  #  - protocol
-  #    + imap
-  #    + mail
-  #  - service
-  #    + dns
-  class CyberError < StandardError
-    attr_accessor :severity, :category
-
-    #include GetTextSupport
-
-    def initialize(severity, category, message)
-      @severity = severity
-      @category = category
-      super(message)
-    end
-  end
-end
diff --git a/lib/cyborghood/info.rb b/lib/cyborghood/info.rb
deleted file mode 100644
index 45d53df..0000000
--- a/lib/cyborghood/info.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-module CyborgHood
-  PRODUCT = "CyborgHood"
-  VERSION = "0.2.0~dev"
-end
diff --git a/lib/cyborghood/lang_additions.rb b/lib/cyborghood/lang_additions.rb
deleted file mode 100644
index efbff3b..0000000
--- a/lib/cyborghood/lang_additions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# CyborgHood, a distributed system management software.
-# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
-#
-# 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 3 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/>.
-#++
-
-require 'ostruct'
-
-class Hash
-  def to_ostruct
-    data = self.dup
-    data.each_pair do |k, v|
-      data[k] = v.to_ostruct if v.is_a?(Hash)
-    end
-    OpenStruct.new(data)
-  end
-end
-
-class Object
-  def logger
-    CyborgHood::Logger.instance
-  end
-
-  def self.human_name
-    self.name.split("::").last
-  end
-  def human_name
-    self.class.human_name
-  end
-end
-
-# WARNING: the TMail send_to() method is _unsuable_, even with the following fixes
-require 'tmail'
-module TMail
-  class Mail
-    # fix method using obsoleted from_address() method
-    def do_send_to( smtp )
-      from = from_addrs or raise ArgumentError, 'no from address'
-      (dests = destinations).empty? and raise ArgumentError, 'no receipient'
-      yield
-      send_to_0 smtp, from, dests
-    end
-
-    # fix method using encoded() with a wrong number of args
-    def send_to_0( smtp, from, to )
-      smtp.ready(from, to) do |f|
-        encoded "\r\n", 'j', f
-      end
-    end
-  end
-end
diff --git a/lib/cyborghood/language.rb b/lib/cyborghood/language.rb
deleted file mode 100644
index 36375bd..0000000
--- a/lib/cyborghood/language.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-#--
-# CyborgHood, a distributed system management software.
-# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
-#
-# 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 3 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/>.
-#++
-
-require 'singleton'
-require 'gettext'
-
-
-module CyborgHood
-  class I18nController
-    include Singleton
-    include GetText
-
-    def initialize
-      @config = Config.instance
-    end
-
-    def available_languages
-      list = ['en'] + Dir.new(Config::L10N_DIR).select{|d| File.directory?(File.join(Config::L10N_DIR, d)) and d[0..0] != "." }
-      # local admin can restrict available languages
-      # (may be useful if l10n is partial due to third party plugins)
-      list = list & @config.i18n.restricted_language_set if @config.i18n.restricted_language_set
-      list = ['en'] if list.empty?
-      list
-    end
-
-    def set_language(lang)
-      set_locale_all(lang)
-    end
-
-    def set_default_language
-      set_language('en')
-    end
-
-    def set_language_for_user(user)
-      if user.nil?
-        set_default_language
-      else
-        logger.debug "User preference for language: " + user.preferredLanguage
-
-        lang = user.prefered_language(self.available_languages)
-        if lang.nil?
-          logger.debug "No available language fits the user preference, using english"
-          lang = 'en'
-        else
-          logger.debug "Language better fitting user preference: " + lang
-        end
-
-        set_language(lang)
-      end
-    end
-  end
-
-  class I18nMessage
-    attr_reader :translated, :untranslated, :parts
-
-    def initialize(translated, untranslated, parts)
-      @translated = translated % parts
-      @untranslated = untranslated % parts
-      @parts = parts
-    end
-
-    def to_s
-      @translated
-    end
-  end
-
-  module I18nTranslation
-    def self.included(base)
-      base.class_eval("include GetText")
-
-      # translation methods needs to be available at class level too
-      base.extend(self)
-    end
-    include GetText
-
-    alias :_orig :_
-    def _(message, parts = {})
-      create_tm(:_orig, message, parts)
-    end
-
-    alias :n_orig :n_
-    def n_(message, parts = {})
-      create_tm(:n_orig, message, parts)
-    end
-
-    alias :s_orig :s_
-    def s_(message, parts = {})
-      create_tm(:s_orig, message, parts)
-    end
-
-    alias :ns_orig :ns_
-    def ns_(message, parts = {})
-      create_tm(:ns_orig, message, parts)
-    end
-
-    alias :np_orig :np_
-    def np_(message, parts = {})
-      create_tm(:np_orig, message, parts)
-    end
-
-    def create_tm(method, message, parts)
-      I18nMessage.new(self.send(method, message), message, parts)
-    end
-
-    module_function :_, :n_, :s_, :ns_, :np_
-  end
-end
diff --git a/lib/cyborghood/logger.rb b/lib/cyborghood/logger.rb
deleted file mode 100644
index 85a0985..0000000
--- a/lib/cyborghood/logger.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#--
-# CyborgHood, a distributed system management software.
-# Copyright (c) 2009 Marc Dequènes (Duck) <Duck@DuckCorp.org>
-#
-# 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 3 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/>.
-#++
-
-require 'singleton'
-require 'log4r'
-
-module CyborgHood
-  class Logger < Log4r::Logger
-    include Singleton
-
-    LOG_FORMAT = "[%5l - %d] #PREFIX#%m"
-
-    def output_level(level)
-      l = case level
-      when :verbose
-        Log4r::DEBUG
-      when :quiet
-        Log4r::FATAL
-      else # normal
-        Log4r::WARN
-      end
-      @main_outputter.level = l
-    end
-
-    def log_to_file(filename)
-      file_outputter = Log4r::FileOutputter.new(filename, :filename => filename)
-      file_outputter.formatter = @default_formatter
-      self.outputters << file_outputter
-    end
-
-    def set_prefix(prefix = "")
-      prefix ||= ""
-      log_format = LOG_FORMAT.gsub("#PREFIX#", prefix)
-      @default_formatter = Log4r::PatternFormatter.new(:pattern => log_format)
-      self.outputters.each{|outputter| outputter.formatter = @default_formatter }
-    end
-
-    private
-
-    def initialize
-      super(PRODUCT)
-
-      self.level = Log4r::DEBUG
-      @main_outputter = Log4r::Outputter.stdout
-      @main_outputter.level = Log4r::WARN
-      self.outputters = [@main_outputter]
-
-      set_prefix()
-    end
-  end
-end
diff --git a/post-clean.rb b/post-clean.rb
index d87ba3d..4aa5b81 100644
--- a/post-clean.rb
+++ b/post-clean.rb
@@ -18,5 +18,5 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #++
 
-conffile = "lib/cyborghood/config_setup.rb"
+conffile = 'lib/cyborghood/base/config_setup.rb'
 File.unlink(conffile) if FileTest.exists?(conffile)
diff --git a/post-config.rb b/post-config.rb
index 5d12799..47732ca 100644
--- a/post-config.rb
+++ b/post-config.rb
@@ -47,7 +47,7 @@ HEADER
 
 # Generate config_setup.rb containing general compile/setup time configuration
 # information (in the CoinDiff::Config module).
-File.open('lib/cyborghood/config_setup.rb', 'w') do |file|
+File.open('lib/cyborghood/base/config_setup.rb', 'w') do |file|
 
   file.print header
   file.print <<-CONFIG
