class Traces::Config

Represents a configuration for the traces library.

def self.default

@returns [Config] The default configuration.
Load the default configuration.
def self.default
	@default ||= self.load(DEFAULT_PATH)
end

def self.load(path)

@returns [Config] The loaded configuration.
@parameter path [String] The path to the configuration file.
Load the configuration from the given path.
def self.load(path)
	config = self.new
	
	if File.exist?(path)
		config.instance_eval(File.read(path), path)
	end
	
	return config
end

def prepare

Prepare the backend, e.g. by loading additional libraries or instrumentation.
def prepare
end

def require_backend(env = ENV)

Require a specific traces backend implementation.
def require_backend(env = ENV)
	if backend = env['TRACES_BACKEND']
		begin
			if require(backend)
				Traces.extend(Backend::Interface)
				
				return true
			end
		rescue LoadError => error
			warn "Unable to load traces backend: #{backend.inspect}!"
		end
	end
	
	return false
end