changeset 244:c50dc3c4136e

Re #425: FileLoadFailure when starting WarFoundry * Try getting more debug information out of the class
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Aug 2012 11:19:32 +0100
parents 425912324be5
children 3aacaa74587f
files FrmMain.cs
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/FrmMain.cs	Sat May 19 20:16:21 2012 +0100
     1.2 +++ b/FrmMain.cs	Sun Aug 26 11:19:32 2012 +0100
     1.3 @@ -31,6 +31,7 @@
     1.4  using IBBoard.WarFoundry.API.Savers.Xml;
     1.5  using IBBoard.WarFoundry.API.Factories;
     1.6  using IBBoard.WarFoundry.API.Factories.Xml;
     1.7 +using System.Reflection;
     1.8  
     1.9  namespace IBBoard.WarFoundry.GUI.WinForms
    1.10  {
    1.11 @@ -659,7 +660,16 @@
    1.12  		{
    1.13  			foreach (FileLoadFailure failure in failures)
    1.14  			{
    1.15 -				log.Warn("Failed to load " + failure.FailedFile.FullName + ": " + failure.Message);
    1.16 +				log.DebugFormat("Got failure of type {0}", failure.FailedFile.GetType().Name);
    1.17 +				foreach (MethodInfo method in failure.FailedFile.GetType().GetMethods())
    1.18 +				{
    1.19 +					log.DebugFormat("    Got method {0} {1} {2}", method.IsPrivate ? "private" : "public",  method.ReturnType.Name, method.Name);
    1.20 +				}
    1.21 +				foreach (PropertyInfo property in failure.FailedFile.GetType().GetProperties())
    1.22 +				{
    1.23 +					log.DebugFormat("    Got property {0} {1}", property.PropertyType.Name, property.Name);
    1.24 +				}
    1.25 +				log.WarnFormat("Failed to load {0}: {1}", failure.FailedFile.Name, failure.Message);
    1.26  			}
    1.27  		}
    1.28