public void NormalizeReceivedData(string?unused = null) { if (this.KeyType._IsEmpty()) { this.KeyType = "all"; } if (this.KeyShortValue._IsEmpty()) { this.KeyShortValue = "all"; } if (this.KeyFullValue._IsEmpty()) { this.KeyFullValue = "all"; } this.SystemName = WinParser.MakeSafeFileName(this.SystemName._NonNullTrim()).ToLowerInvariant()._TruncStr(Consts.MaxLens.DataVaultPathElementMaxLen); this.LogName = WinParser.MakeSafeFileName(this.LogName._NonNullTrim()).ToLowerInvariant()._TruncStr(Consts.MaxLens.DataVaultPathElementMaxLen); this.KeyType = WinParser.MakeSafeFileName(this.KeyType._NonNullTrim()).ToLowerInvariant()._TruncStr(Consts.MaxLens.DataVaultPathElementMaxLen); this.KeyShortValue = WinParser.MakeSafeFileName(this.KeyShortValue._NonNullTrim()).ToLowerInvariant()._TruncStr(Consts.MaxLens.DataVaultPathElementMaxLen); this.KeyFullValue = WinParser.MakeSafeFileName(this.KeyFullValue._NonNullTrim()).ToLowerInvariant()._TruncStr(Consts.MaxLens.DataVaultPathElementMaxLen); if (this.TimeStamp == default) { this.TimeStamp = Util.ZeroDateTimeOffsetValue; } }
public void NormalizeReceivedLog(string defaultSrcMachineName) { this.Guid = WinParser.MakeSafeFileName(this.Guid); this.MachineName = WinParser.MakeSafeFileName(this.MachineName); this.AppName = WinParser.MakeSafeFileName(this.AppName); this.Kind = WinParser.MakeSafeFileName(this.Kind); this.Priority = WinParser.MakeSafeFileName(this.Priority); this.Tag = WinParser.MakeSafeFileName(this.Tag); this.TypeName = WinParser.MakeSafeFileName(this.TypeName); if (this.TimeStamp == null) { this.TimeStamp = DateTimeOffset.Now; } if (this.Guid._IsEmpty()) { this.Guid = Str.NewGuid(); } this.MachineName = this.MachineName._NonNullTrim().ToLowerInvariant(); if (this.MachineName._IsEmpty()) { this.MachineName = defaultSrcMachineName; } if (this.AppName._IsEmpty()) { this.AppName = "unknown"; } if (this.Kind._IsEmpty()) { this.Kind = LogKind.Default; } if (this.Priority._IsEmpty()) { this.Priority = LogPriority.None.ToString(); } if (this.Tag._IsEmpty()) { this.Tag = LogTag.None; } if (this.TypeName._IsEmpty()) { this.TypeName = "unknown"; } }