-
Notifications
You must be signed in to change notification settings - Fork 470
Replace ILLamaLogger for ILogger implementation #157
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
Conversation
Thinking outloud... If there is a We could then setup default |
This commit is the basic idea we could use, like I said the static factory may be a bit ugly, but it does allow for easy inlitalization of a logger thoughout the codebase Now users can just pass down any ILoggerFactory into the configure and use their own logging framework. Just one idea anyway. |
I was thinking on making the same. I will be happier using ILogger than a specific logger per library (that makes log a mess). In my opinion to move the code base to use ILogger is a very good idea. |
That scenario is even easier, just pass in the ILogger to the constructor, if you have one, no need for a Logger class at all I dont mind any of these scenarios, just having ILogger is enough for me |
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="0.21.230828.2-preview" /> | ||
<PackageReference Include="System.Memory" Version="4.5.5" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should System.Memory
be in a <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
group, same as LLamaSharp?
I like this change a lot. Losing all the complexity of maintaining our own logger and becoming more compatible with the general ecosystem at the same time 🥳 |
If we are just going to delete the Logger class and just carry on with passing in loggers into the constructors then I might close this and open another PR to remove all the commit mess of the ILoggerFactory, I only went that route so we have a "Log Anywhere" solution in the codebase |
I can just make sure to |
Looking to improve the logging, I think using the Microsoft ILogger framework may be a good move, so just opening this PR to begin discussion.
As this will be used in .NET apps and there are many great ILogger packages out there I thought maintaing our own may be just extra work.
I think just adding a clean way for users to register thier logger, and a way to make logging a bit friendlier around the lib could be good too, not DI or anything but passing loggers in constructors is annoying so perhaps a sneaky LogManager class could help, bit of an anti-pattern but would encourage more devs to log if was easy to setup.
This commit is just a as-is replacement, does nothing to address the current DefaultLogger or how its used.
Thoughts?