apache / logging-log4net

Apache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET
https://logging.apache.org/log4net
Apache License 2.0
859 stars 327 forks source link

Remove deprecated code for 3.0 #125

Closed erikmav closed 5 months ago

erikmav commented 7 months ago

There are numerous parts of the code that are marked with [Obsolete] attributes. Additionally there is code that may or may not any longer be in use, such as NDC (src/log4net/NDC.cs). Ideally with the major version change the deprecations should be removed.

FreeAndNil commented 7 months ago

I agree with removing the obsolete classes and methods.

I'm not sure about NDC. Looking at the code it seems to be explicitly un-deprecated and there are many uses https://github.com/search?q=NDC.Push+path%3A*.cs+language%3AC%23&type=Code&ref=advsearch&l=C%23&l=

The class is just a wrapper around ThreadContext.Stacks["NDC"], so the gain for removing it would be small against the anger we could cause ;-)

When we DO want to remove it, we would do it later and first mak it (again) as deprecated.

@fluffynuts what do you think?

fluffynuts commented 7 months ago

I agree - something marked [Obsolete] can go, something that still works, even if it's only for a few users, can stay. And we should be very judicial about deprecations - I'd much rather keep the library useful for as many people as possible, so even if some part looks unused, if it works, leave it in until there's no other option but to lose it.

FreeAndNil commented 7 months ago

OK. I would propose releasing the first 3.0.0 preview with the obsolete classes, so that we could deploy this version in our company and to other "willing" users. Then we remove those classes in the next preview for 3.0.0.

FreeAndNil commented 7 months ago

Deleted obsolete API:

Other changes: