necessary things

This commit is contained in:
appelemac 2016-08-21 19:45:15 +02:00
parent 89a0eb93e6
commit 5d5b06ddd3
2 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,7 @@ namespace NadekoBot
Localizer = new Localization();
Youtube = new YoutubeService();
Stats = new StatsService(Client);
_log = LogManager.GetCurrentClassLogger();
//setup DI
var depMap = new DependencyMap();
@ -73,6 +73,7 @@ namespace NadekoBot
private void SetupLogger()
{
try
{
var logConfig = new LoggingConfiguration();
@ -85,10 +86,12 @@ namespace NadekoBot
logConfig.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, consoleTarget));
LogManager.Configuration = logConfig;
}
catch (Exception ex) {
Console.WriteLine(ex);
}
_log = LogManager.GetCurrentClassLogger();
}
private Task Client_MessageReceived(IMessage imsg)

View File

@ -27,6 +27,7 @@ namespace NadekoBot.Services.Impl
public BotCredentials()
{
File.WriteAllText("./credentials_example.json", JsonConvert.SerializeObject(new CredentialsModel(), Formatting.Indented));
_log = LogManager.GetCurrentClassLogger();
if (File.Exists("./credentials.json"))
{