Think it’s necessary to mock ILogger?

by Aug 25, 2023

Think it’s necessary to mock ILogger?

Using Moq or NSubstitute to do this? Think again.

In the C# world, many developers do this – but there’s a more efficient way.

Enter NullLogger.

NullLogger, a minimalist logger from Microsoft, lets you fulfill your dependency without any fuss. All while doing… well, nothing.

Creating an instance? It’s as simple as ‘NullLogger.Instance’.

Give it a try next time you’re coding. You might just find it changes your approach completely.

So, who’s ready to ditch the old method and embrace NullLogger?


Subscribe to
The Daily Friction

A daily newsletter on automation and eliminating friction

Related Content

Standup meetings

Standup meetings Why have a Teams channel where everyone can post what they are struggling with, so anyone can respond to help and start a 1-on-1 call. If we can have 15-min meetings informing everyone once a day.

read more

Complexity <> Sophisticated

Complexity <> Sophisticated It can be just overly complex, because the person who created it didn't understand it well enough. Teachers face the challenge of breaking down complex subjects for their students. The ability to simplify abstract ideas without losing...

read more
Share This