Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Cleaned up/improved some of the logging statements I came across duri…
Browse files Browse the repository at this point in the history
…ng debugging today.
  • Loading branch information
dodexahedron committed Apr 4, 2015
1 parent e49d49c commit 1a15983
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions EssentialsPlugin/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ private void DoInit(string path)
MyAPIGateway.Entities.OnEntityAdd += OnEntityAdd;
MyAPIGateway.Entities.OnEntityRemove += OnEntityRemove;

Log.Info(string.Format("Plugin '{0}' initialized. (Version: {1} ID: {2})", Name, Version, Id));
Log.Info( "Plugin '{0}' initialized. (Version: {1} ID: {2})", Name, Version, Id );
}

#endregion
Expand All @@ -946,7 +946,7 @@ private void PluginProcessing()
}
catch (Exception ex)
{
Log.Info(String.Format("Handler Problems: {0} - {1}", currentHandler.GetUpdateResolution(), ex));
Log.Info( "Handler Problems: {0} - {1}", currentHandler.GetUpdateResolution(), ex );
}
// Let's make sure LastUpdate is set to now otherwise we may start processing too quickly
Expand Down Expand Up @@ -1012,17 +1012,19 @@ private void PluginProcessing()
#region IPlugin Members
public void Init()
{
Log.Debug( "Initializing Essentials plugin at path {0}\\", Path.GetDirectoryName( Assembly.GetExecutingAssembly( ).Location ) );
DoInit(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\");
}

public void InitWithPath(String modPath)
{
Log.Debug( "Initializing Essentials plugin at path {0}\\", Path.GetDirectoryName( modPath ) );
DoInit(Path.GetDirectoryName(modPath) + "\\");
}

public void Shutdown()
{
Log.Info(string.Format("Shutting down plugin: {0} - {1}", Name, Version));
Log.Info( "Shutting down plugin: {0} - {1}", Name, Version );

foreach (Thread thread in _processThreads)
thread.Abort();
Expand Down
10 changes: 7 additions & 3 deletions EssentialsPlugin/Utility/Docking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ public class Docking
public Docking()
{
string dockingFolderPath = Path.Combine(Essentials.PluginPath , "\\Docking");

if (!Directory.Exists(dockingFolderPath))
{
Log.Info( "Creating docking folder at {0}", dockingFolderPath );
Directory.CreateDirectory(dockingFolderPath);
}
}

public static Docking Instance
Expand Down Expand Up @@ -60,7 +64,7 @@ public void Save()
}
catch (Exception ex)
{
Log.Info(string.Format("Save(): {0}", ex));
Log.Error( ex );
}
}
}
Expand All @@ -86,12 +90,12 @@ public void Load()
reader.Close();
}

Log.Info(string.Format("Loaded {0} Docking Items", _instance.DockingItems));
Log.Info( "Loaded {0} Docking Items from {1}", _instance.DockingItems.Count, fileName );
}
}
catch (Exception ex)
{
Log.Info(string.Format("Load(): {0}", ex));
Log.Error( ex );
}
finally
{
Expand Down

0 comments on commit 1a15983

Please sign in to comment.