mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
27 lines
866 B
C#
27 lines
866 B
C#
using System;
|
|
using NuGet;
|
|
using Orchard.Localization;
|
|
using Orchard.UI.Notify;
|
|
|
|
namespace Orchard.Packaging.Services {
|
|
public class NugetLogger : ILogger {
|
|
private readonly INotifier _notifier;
|
|
|
|
public NugetLogger(INotifier notifier) {
|
|
_notifier = notifier;
|
|
}
|
|
|
|
public void Log(MessageLevel level, string message, params object[] args) {
|
|
switch ( level ) {
|
|
case MessageLevel.Debug:
|
|
break;
|
|
case MessageLevel.Info:
|
|
_notifier.Information(new LocalizedString(String.Format(message, args)));
|
|
break;
|
|
case MessageLevel.Warning:
|
|
_notifier.Warning(new LocalizedString(String.Format(message, args)));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} |