internal void Report(IResourceLeak resourceLeak) { string records = resourceLeak.ToString(); if (!this.reportedLeaks.TryAdd(records, true)) { return; } Log.Error(records.Length == 0 ? $"LEAK: {this.resourceType}.Release() was not called before it's garbage-collected." : $"LEAK: {this.resourceType}.Release() was not called before it's garbage-collected. {records}"); }
internal void Report(IResourceLeak resourceLeak) { string records = resourceLeak.ToString(); if (this.reportedLeaks.TryAdd(records, true)) { if (records.Length == 0) { Logger.Error("LEAK: {}.Release() was not called before it's garbage-collected. " + "Enable advanced leak reporting to find out where the leak occurred. " + "To enable advanced leak reporting, " + "set environment variable {} to {} or set {}.Level in code. " + "See http://netty.io/wiki/reference-counted-objects.html for more information.", this.resourceType, PropLevel, DetectionLevel.Advanced.ToString().ToLowerInvariant(), StringUtil.SimpleClassName(this)); } else { Logger.Error( "LEAK: {}.release() was not called before it's garbage-collected. " + "See http://netty.io/wiki/reference-counted-objects.html for more information.{}", this.resourceType, records); } } }