This commit is contained in:
JustArchi
2018-03-17 14:14:56 +01:00
parent d73a578a13
commit 2faf537a42
3 changed files with 13 additions and 8 deletions

View File

@@ -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 _)) { }

View File

@@ -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) {

View File

@@ -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) {