Don't log to console if running from folder containing 'deploy' in name

This commit is contained in:
runebaas 2018-01-15 19:31:49 +01:00
parent 70e4cf249f
commit b6d7e76bdb
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -9,8 +9,11 @@ namespace Geekbot.net.Lib
public static ILogger createLogger(string[] args)
{
var loggerCreation = new LoggerConfiguration()
.WriteTo.LiterateConsole()
.WriteTo.RollingFile("Logs/geekbot-{Date}.txt", shared: true);
if (!Environment.CurrentDirectory.Contains("deploy"))
{
loggerCreation.WriteTo.LiterateConsole();
}
if (args.Contains("--verbose"))
{
loggerCreation.MinimumLevel.Verbose();