diff options
author | Justin Clark-Casey (justincc) | 2011-03-25 23:18:47 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-25 23:18:47 +0000 |
commit | ea72745d43c2c6eced8329801ff8765746be7ddd (patch) | |
tree | 4af2ae1387e257d7bb7f25b2def957941d488393 /OpenSim/Framework | |
parent | Add ILandObject.IPrimCounts for the new prim count module. (diff) | |
download | opensim-SC_OLD-ea72745d43c2c6eced8329801ff8765746be7ddd.zip opensim-SC_OLD-ea72745d43c2c6eced8329801ff8765746be7ddd.tar.gz opensim-SC_OLD-ea72745d43c2c6eced8329801ff8765746be7ddd.tar.bz2 opensim-SC_OLD-ea72745d43c2c6eced8329801ff8765746be7ddd.tar.xz |
Log the xml/ini regions config files that opensim loads from, and the regions that it loaded from them
This will show up with the lines [REGION LOADER FILE SYSTEM]: Loading config files from ./Regions, etc.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 63e09ae..7cbd5ed 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | |||
@@ -25,15 +25,19 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | ||
28 | using System; | 29 | using System; |
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | ||
31 | using Nini.Config; | 33 | using Nini.Config; |
32 | 34 | ||
33 | namespace OpenSim.Framework.RegionLoader.Filesystem | 35 | namespace OpenSim.Framework.RegionLoader.Filesystem |
34 | { | 36 | { |
35 | public class RegionLoaderFileSystem : IRegionLoader | 37 | public class RegionLoaderFileSystem : IRegionLoader |
36 | { | 38 | { |
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
40 | |||
37 | private IConfigSource m_configSource; | 41 | private IConfigSource m_configSource; |
38 | 42 | ||
39 | public void SetIniConfigSource(IConfigSource configSource) | 43 | public void SetIniConfigSource(IConfigSource configSource) |
@@ -63,36 +67,48 @@ namespace OpenSim.Framework.RegionLoader.Filesystem | |||
63 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 67 | string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
64 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 68 | string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
65 | 69 | ||
70 | // Create an empty Regions.ini if there are no existing config files. | ||
66 | if (configFiles.Length == 0 && iniFiles.Length == 0) | 71 | if (configFiles.Length == 0 && iniFiles.Length == 0) |
67 | { | 72 | { |
68 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); | 73 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); |
69 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); | 74 | iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); |
70 | } | 75 | } |
76 | |||
77 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); | ||
71 | 78 | ||
72 | List<RegionInfo> regionInfos = new List<RegionInfo>(); | 79 | List<RegionInfo> regionInfos = new List<RegionInfo>(); |
73 | 80 | ||
74 | int i = 0; | 81 | int i = 0; |
75 | foreach (string file in iniFiles) | 82 | foreach (string file in iniFiles) |
76 | { | 83 | { |
84 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | ||
85 | |||
77 | IConfigSource source = new IniConfigSource(file); | 86 | IConfigSource source = new IniConfigSource(file); |
78 | 87 | ||
79 | foreach (IConfig config in source.Configs) | 88 | foreach (IConfig config in source.Configs) |
80 | { | 89 | { |
81 | //m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name); | ||
82 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); | 90 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); |
83 | regionInfos.Add(regionInfo); | 91 | regionInfos.Add(regionInfo); |
92 | |||
93 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded region {0}", regionInfo.RegionName); | ||
94 | |||
84 | i++; | 95 | i++; |
85 | } | 96 | } |
86 | } | 97 | } |
87 | 98 | ||
88 | foreach (string file in configFiles) | 99 | foreach (string file in configFiles) |
89 | { | 100 | { |
101 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); | ||
102 | |||
90 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); | 103 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); |
91 | regionInfos.Add(regionInfo); | 104 | regionInfos.Add(regionInfo); |
105 | |||
106 | m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded region {0}", regionInfo.RegionName); | ||
107 | |||
92 | i++; | 108 | i++; |
93 | } | 109 | } |
94 | 110 | ||
95 | return regionInfos.ToArray(); | 111 | return regionInfos.ToArray(); |
96 | } | 112 | } |
97 | } | 113 | } |
98 | } | 114 | } \ No newline at end of file |