mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Fixed issue with logging even though BotLog is disabled
This commit is contained in:
@@ -367,7 +367,7 @@ namespace RuriLib
|
||||
switch (RequestType)
|
||||
{
|
||||
case RequestType.Standard:
|
||||
request.SetStandardContent(ReplaceValues(PostData, data), ReplaceValues(ContentType, data), Method, EncodeContent, data.LogBuffer);
|
||||
request.SetStandardContent(ReplaceValues(PostData, data), ReplaceValues(ContentType, data), Method, EncodeContent, GetLogBuffer(data));
|
||||
break;
|
||||
|
||||
case RequestType.BasicAuth:
|
||||
@@ -383,7 +383,7 @@ namespace RuriLib
|
||||
ContentType = ReplaceValues(m.Value, data),
|
||||
Type = m.Type
|
||||
});
|
||||
request.SetMultipartContent(contents, ReplaceValues(MultipartBoundary, data), data.LogBuffer);
|
||||
request.SetMultipartContent(contents, ReplaceValues(MultipartBoundary, data), GetLogBuffer(data));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ namespace RuriLib
|
||||
var headers = CustomHeaders.Select( h =>
|
||||
new KeyValuePair<string, string> (ReplaceValues(h.Key, data), ReplaceValues(h.Value, data))
|
||||
).ToDictionary(h => h.Key, h => h.Value);
|
||||
request.SetHeaders(headers, AcceptEncoding, data.LogBuffer);
|
||||
request.SetHeaders(headers, AcceptEncoding, GetLogBuffer(data));
|
||||
|
||||
// Set cookies
|
||||
data.Log(new LogEntry("Sent Cookies:", Colors.MediumTurquoise));
|
||||
@@ -406,7 +406,7 @@ namespace RuriLib
|
||||
foreach (var cookie in CustomCookies) // Add new user-defined custom cookies to the bot's cookie jar
|
||||
data.Cookies[ReplaceValues(cookie.Key, data)] = ReplaceValues(cookie.Value, data);
|
||||
|
||||
request.SetCookies(data.Cookies, data.LogBuffer);
|
||||
request.SetCookies(data.Cookies, GetLogBuffer(data));
|
||||
|
||||
// End the request part
|
||||
data.LogNewLine();
|
||||
@@ -418,7 +418,7 @@ namespace RuriLib
|
||||
switch (ResponseType)
|
||||
{
|
||||
case ResponseType.String:
|
||||
data.ResponseSource = request.SaveString(ReadResponseSource, data.ResponseHeaders, data.LogBuffer);
|
||||
data.ResponseSource = request.SaveString(ReadResponseSource, data.ResponseHeaders, GetLogBuffer(data));
|
||||
break;
|
||||
|
||||
case ResponseType.File:
|
||||
@@ -429,7 +429,7 @@ namespace RuriLib
|
||||
}
|
||||
else
|
||||
{
|
||||
request.SaveFile(ReplaceValues(DownloadPath, data), data.LogBuffer);
|
||||
request.SaveFile(ReplaceValues(DownloadPath, data), GetLogBuffer(data));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -541,5 +541,7 @@ namespace RuriLib
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private List<LogEntry> GetLogBuffer(BotData data) => data.GlobalSettings.General.EnableBotLog ? data.LogBuffer : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user