microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Extensions/Microsoft.Teams.Extensions.Logging/LogLevelExtensions.cs
20lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using Microsoft.Extensions.Logging; |
| 5 | |
| 6 | namespace Microsoft.Teams.Extensions.Logging; |
| 7 | |
| 8 | public static class LogLevelExtensions |
| 9 | { |
| 10 | public static Common.Logging.LogLevel ToTeams(this LogLevel level) |
| 11 | { |
| 12 | return level switch |
| 13 | { |
| 14 | LogLevel.Information => Common.Logging.LogLevel.Info, |
| 15 | LogLevel.Warning => Common.Logging.LogLevel.Warn, |
| 16 | LogLevel.Error or LogLevel.Critical => Common.Logging.LogLevel.Error, |
| 17 | _ => Common.Logging.LogLevel.Debug |
| 18 | }; |
| 19 | } |
| 20 | } |