diff --git a/isometric-park-fna/Engines/Spawners/ContractSpawner.cs b/isometric-park-fna/Engines/Spawners/ContractSpawner.cs --- a/isometric-park-fna/Engines/Spawners/ContractSpawner.cs +++ b/isometric-park-fna/Engines/Spawners/ContractSpawner.cs @@ -104,7 +104,7 @@ var start_y = random_generator.Next(0, 50); Logging.Spy(start_x, nameof(start_x)); - Logging.Spy(new {start_x}); + Logging.Spy(new {start_x, start_y}); int max_squares = (message.max_squares == 0) ? DEFAULT_SQUARES : message.max_squares; int min_squares = (message.min_squares == null) ? DEFAULT_MIN_SQUARES : (int)message.min_squares; diff --git a/isometric-park-fna/Logging.cs b/isometric-park-fna/Logging.cs --- a/isometric-park-fna/Logging.cs +++ b/isometric-park-fna/Logging.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using System.Reflection; +// using System.Linq; /* Tiny log library inspired by Python's logging and Glögi. */ @@ -154,8 +156,20 @@ ) where T : class { - string message = string.Format("{0} = {1}", - value.ToString(), typeof(T).GetProperties()[0].ToString() ); + // var properties = typeof(T).GetProperties(); + // string message = string.Format("{0} = {1}", + // value.ToString(), .ToString() ); + // var message = String.Join(", ", (object[])properties); + + var properties = new List(); + + foreach (var property in typeof(T).GetProperties()) + { + properties.Add(property.ToString() + "=" + property.GetValue(value)); + } + + var message = "{" + String.Join(", ", properties) + "}"; + Logging.Log_(LogLevel.Spy, message, lineNumber, caller, path); } }