Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush messages on close #12

Closed
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

refactoring - extract methods IsBulkMode() and IsInputsMode() to redu…

…ce duplication
  • Loading branch information
Richard Nagle
Richard Nagle committed Oct 30, 2017
commit 55ff69af33dc0f3e01aa05cc2e37d696f27de350
@@ -44,7 +44,7 @@ void t_Elapsed(object sender, Timer.ElapsedEventArgs e)
{
SendAllEvents(lstLogs.ToArray());
}
_sendBufferedLogs.sendBufferedLogsToLoggly(Config, Config.LogMode == "bulk/");
_sendBufferedLogs.sendBufferedLogsToLoggly(Config, IsBulkMode());
}

protected override void Append(LoggingEvent loggingEvent)
@@ -73,11 +73,11 @@ private void SendLogAction(LoggingEvent loggingEvent)
}

//check if logMode is bulk or inputs
if (Config.LogMode == "bulk/")
if (IsBulkMode())
{
addToBulk(_formattedLog);
}
else if (Config.LogMode == "inputs/")
else if (IsInputsMode())
{
//sending _formattedLog to the async queue
LogglyAsync.PostMessage(_formattedLog, Config);
@@ -101,5 +101,14 @@ private void SendAllEvents(string[] events)
LogglyAsync.PostMessage(bulkLog, Config);
}

}
}
private bool IsBulkMode()
{
return Config.LogMode == "bulk/";
}

private bool IsInputsMode()
{
return Config.LogMode == "inputs/";
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.