mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Fixes #765
This commit is contained in:
@@ -31,6 +31,11 @@ namespace ArchiSteamFarm {
|
||||
internal byte MaxCount {
|
||||
get => _MaxCount;
|
||||
set {
|
||||
if (value == 0) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(value));
|
||||
return;
|
||||
}
|
||||
|
||||
_MaxCount = value;
|
||||
|
||||
while ((BackingQueue.Count > MaxCount) && BackingQueue.TryDequeue(out _)) { }
|
||||
|
||||
@@ -51,9 +51,12 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
// This constructor is intentionally public, as NLog uses it for creating targets
|
||||
// This parameterless(!) constructor is intentionally public, as NLog uses it for creating targets
|
||||
// It must stay like this as we want to have our targets defined in our NLog.config
|
||||
public HistoryTarget(string name = null) => Name = name;
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public HistoryTarget() { }
|
||||
|
||||
internal HistoryTarget(string name = null) => Name = name;
|
||||
|
||||
protected override void Write(LogEventInfo logEvent) {
|
||||
if (logEvent == null) {
|
||||
|
||||
@@ -42,13 +42,10 @@ namespace ArchiSteamFarm {
|
||||
[RequiredParameter]
|
||||
public ulong SteamID { get; set; }
|
||||
|
||||
// This constructor is intentionally public, as NLog uses it for creating targets
|
||||
// This parameterless(!) constructor is intentionally public, as NLog uses it for creating targets
|
||||
// It must stay like this as we want to have our targets defined in our NLog.config
|
||||
// Keeping date in default layout also doesn't make much sense, so we remove it by default
|
||||
public SteamTarget(string name = null) {
|
||||
Name = name;
|
||||
Layout = "${level:uppercase=true}|${logger}|${message}";
|
||||
}
|
||||
// Keeping date in default layout also doesn't make much sense (Steam offers that), so we remove it by default
|
||||
public SteamTarget() => Layout = "${level:uppercase=true}|${logger}|${message}";
|
||||
|
||||
protected override async void Write(LogEventInfo logEvent) {
|
||||
if (logEvent == null) {
|
||||
|
||||
Reference in New Issue
Block a user