Mineplex2018-withcommit/Website/LOC.Website.Common/Logger.cs
Jonathan Williams 3fb52c5c71 Initial Commit
2013-08-27 08:14:08 -07:00

32 lines
834 B
C#

namespace LOC.Website.Common
{
using System;
using Contexts;
using Core;
using Data;
public class Logger : ILogger
{
private readonly INautilusRepositoryFactory _nautilusRepositoryFactory;
public Logger(INautilusRepositoryFactory nautilusRepositoryFactory)
{
_nautilusRepositoryFactory = nautilusRepositoryFactory;
}
public void Log(string category, string message)
{
using (var repository = _nautilusRepositoryFactory.CreateRepository())
{
repository.Add(new LogEntry
{
Date = DateTime.Now,
Category = category,
Message = message
});
repository.CommitChanges();;
}
}
}
}