Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ILogger and ILoggerFactory instead of explicit calls to NLog #27

Open
wopietrz opened this issue Mar 11, 2022 · 1 comment
Open

Comments

@wopietrz
Copy link

wopietrz commented Mar 11, 2022

It is not possible to use any other logging framework than NLog right now. The logger should be injected using standard ILogger and ILoggerFactory interfaces. That would remove the strong dependency between NLog and Cybersource Rest Client.

Example of coupling below:

    private static Logger logger;
    private ExceptionFactory _exceptionFactory = (name, response) => null;

    ...
    public KeyGenerationApi(string basePath)
    {
        ...

        if (logger == null)
        {
            logger = LogManager.GetCurrentClassLogger();
        }
    }
@xantari
Copy link

xantari commented Oct 23, 2023

Related to #15 that they closed a few years back...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants