logging output adjustments
This commit is contained in:
parent
d6809cadb5
commit
166c735640
|
@ -5,7 +5,15 @@ namespace Blarg.GameFramework
|
||||||
{
|
{
|
||||||
public class ServiceContainer : IDisposable
|
public class ServiceContainer : IDisposable
|
||||||
{
|
{
|
||||||
Dictionary<Type, object> _services = new Dictionary<Type, object>();
|
const string LOG_TAG = "SERVICES";
|
||||||
|
|
||||||
|
Dictionary<Type, object> _services;
|
||||||
|
|
||||||
|
public ServiceContainer()
|
||||||
|
{
|
||||||
|
_services = new Dictionary<Type, object>();
|
||||||
|
Platform.Logger.Debug(LOG_TAG, "Ready for use.");
|
||||||
|
}
|
||||||
|
|
||||||
public void Register(object service)
|
public void Register(object service)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +30,7 @@ namespace Blarg.GameFramework
|
||||||
((IService)service).OnRegister();
|
((IService)service).OnRegister();
|
||||||
|
|
||||||
_services.Add(type, service);
|
_services.Add(type, service);
|
||||||
Platform.Logger.Debug("ServiceContainer", "Registered object of type {0}.", type);
|
Platform.Logger.Debug(LOG_TAG, "Registered object of type {0}.", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unregister(object service)
|
public void Unregister(object service)
|
||||||
|
@ -42,7 +50,7 @@ namespace Blarg.GameFramework
|
||||||
throw new InvalidOperationException("This is not the service object that was registered under this type.");
|
throw new InvalidOperationException("This is not the service object that was registered under this type.");
|
||||||
|
|
||||||
_services.Remove(type);
|
_services.Remove(type);
|
||||||
Platform.Logger.Debug("ServiceContainer", "Unregistered object of type {0}.", type);
|
Platform.Logger.Debug(LOG_TAG, "Unregistered object of type {0}.", type);
|
||||||
|
|
||||||
|
|
||||||
if (registeredService is IService)
|
if (registeredService is IService)
|
||||||
|
@ -67,7 +75,7 @@ namespace Blarg.GameFramework
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Platform.Logger.Debug("ServiceContainer", "Disposing.");
|
Platform.Logger.Debug(LOG_TAG, "Disposing.");
|
||||||
|
|
||||||
foreach (var i in _services)
|
foreach (var i in _services)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue