Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Moq/Interception/CastleProxyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Text;
#endif

using Castle.Core.Logging;
using Castle.DynamicProxy;

using Moq.Internals;
Expand All @@ -33,7 +34,11 @@ sealed class CastleProxyFactory : ProxyFactory
public CastleProxyFactory()
{
this.generationOptions = new ProxyGenerationOptions { Hook = new IncludeObjectMethodsHook(), BaseTypeForInterfaceProxy = typeof(InterfaceProxy) };
this.generator = new ProxyGenerator();
this.generator = new ProxyGenerator()
{
Logger = NullLogger.Instance,
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative here might be (this.generator.Logger as TraceLogger)?.Level = LoggerLevel.Warn

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that better, yes


this.classGenerators = new ConcurrentDictionary<string, ProxyGenerator>();
}

Expand Down
Loading