diff --git a/src/Mscc.GenerativeAI/BaseModel.cs b/src/Mscc.GenerativeAI/BaseModel.cs index 43795f5..363047f 100644 --- a/src/Mscc.GenerativeAI/BaseModel.cs +++ b/src/Mscc.GenerativeAI/BaseModel.cs @@ -338,7 +338,7 @@ private string RunExternalExe(string filename, string arguments) } catch (Exception e) { - // throw new Exception("OS error while executing " + Format(filename, arguments)+ ": " + e.Message, e); + Logger.LogRunExternalExe("OS error while executing " + Format(filename, arguments)+ ": " + e.Message); return string.Empty; } diff --git a/src/Mscc.GenerativeAI/CHANGELOG.md b/src/Mscc.GenerativeAI/CHANGELOG.md index 018ad12..eb3c5ea 100644 --- a/src/Mscc.GenerativeAI/CHANGELOG.md +++ b/src/Mscc.GenerativeAI/CHANGELOG.md @@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Feature suggestion: Retry mechanism ([#2](https://github.com/mscraftsman/generative-ai/issues/2)) -- Feature suggestion: Add logs with LogLevel using the Standard logging in .NET ([#6](https://github.com/mscraftsman/generative-ai/issues/6)) - implement Automatic Function Call (AFC) ### Changed @@ -18,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 1.8.1 +### Added + +- add logs with LogLevel using the Standard logging in .NET ([#6](https://github.com/mscraftsman/generative-ai/issues/6)) - thanks @doggy8088 + ### Changed - improve regarding XMLdoc, typos, and non-nullable properties diff --git a/src/Mscc.GenerativeAI/Logging/GenerativeModelLogMessages.cs b/src/Mscc.GenerativeAI/Logging/GenerativeModelLogMessages.cs index c76149f..c67c285 100644 --- a/src/Mscc.GenerativeAI/Logging/GenerativeModelLogMessages.cs +++ b/src/Mscc.GenerativeAI/Logging/GenerativeModelLogMessages.cs @@ -44,5 +44,15 @@ public static partial void LogGenerativeModelInvokingRequest( string methodName, string url, string payload); + + /// + /// Logs when exception thrown to run an external application. + /// + /// Optional. Logger instance used for logging + /// Message of to log. + [LoggerMessage(EventId = 0, Level = LogLevel.Warning, Message = "{Message}")] + public static partial void LogRunExternalExe( + this ILogger logger, + string message); } } \ No newline at end of file