Src/Appender/AppVeyorAppender.psm1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using module ..\ILogger.psm1

class AppVeyorAppender: iloggerappender
{
    [void]log([ILoggerEntry]$entry)
    {
        $entry.severity = switch ($entry.severity)
        {
            ([LoggingEventType]::Debug) { [LoggingEventType]::Information }
            ([LoggingEventType]::Fatal) { [LoggingEventType]::Error }
            default { $entry.severity }
        }

        Add-AppveyorMessage $entry.message -Category ([String]$entry.severity)
    }
}