Converted logging to use log4net.

Changed LogBase to ConsoleBase, which handles console I/O.
This is mostly an in-place conversion, so lots of refactoring can still be done.
This commit is contained in:
Jeff Ames
2008-02-05 19:44:27 +00:00
parent 7a61bcff86
commit 6ed5283bc0
173 changed files with 2175 additions and 1950 deletions

View File

@@ -47,10 +47,7 @@ namespace OpenSim.Tools.Export
// AddinManager.Initialize(".");
// AddinManager.Registry.Update(null);
// TODO: this really sucks, but given the way we do
// logging in OpenSim, we need to establish a log up front
MainLog.Instance = CreateLog();
MainConsole.Instance = CreateConsole();
sman = new StorageManager(
startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"),
@@ -61,6 +58,8 @@ namespace OpenSim.Tools.Export
public static void Main(string[] args)
{
log4net.Config.XmlConfigurator.Configure();
OpenSimExport export = new OpenSimExport(InitConfig(args));
RegionInfo reg = new RegionInfo("Sara Jane", "Regions/1000-1000.xml",false);
@@ -71,17 +70,11 @@ namespace OpenSim.Tools.Export
}
}
protected LogBase CreateLog()
protected ConsoleBase CreateConsole()
{
if (!Directory.Exists(Util.logDir()))
{
Directory.CreateDirectory(Util.logDir());
}
return new LogBase((Path.Combine(Util.logDir(), "export.log")), "Export", null, true);
return new ConsoleBase("Export", null);
}
private static IniConfigSource InitConfig(string[] args)
{
Console.WriteLine("Good");