Skip to content

Commit

Permalink
Merge pull request #1 from reportportal/develop
Browse files Browse the repository at this point in the history
Release preparation
  • Loading branch information
nvborisenko authored Aug 5, 2020
2 parents 5c572d0 + 680f24d commit 9139056
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
Binary file modified Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyGet ReportPortal" value="https://www.myget.org/F/reportportal/api/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion ReportPortal.Log4Net/ReportPortal.Log4Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="ReportPortal.Shared" Version="2.3.0" />
<PackageReference Include="ReportPortal.Shared" Version="3.0.0" />
</ItemGroup>

</Project>
29 changes: 14 additions & 15 deletions ReportPortal.Log4Net/ReportPortalAppender.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using ReportPortal.Client.Models;
using ReportPortal.Shared;
using log4net.Appender;
using log4net.Core;
using ReportPortal.Shared.Execution.Logging;

namespace ReportPortal.Log4Net
{
Expand All @@ -12,31 +12,30 @@ namespace ReportPortal.Log4Net
/// </summary>
public class ReportPortalAppender : AppenderSkeleton
{
protected Dictionary<Level, LogLevel> LevelMap = new Dictionary<Level, LogLevel>();
protected Dictionary<Level, LogMessageLevel> LevelMap = new Dictionary<Level, LogMessageLevel>();
public ReportPortalAppender()
{
LevelMap[Level.Fatal] = LogLevel.Fatal;
LevelMap[Level.Error] = LogLevel.Error;
LevelMap[Level.Warn] = LogLevel.Warning;
LevelMap[Level.Info] = LogLevel.Info;
LevelMap[Level.Debug] = LogLevel.Debug;
LevelMap[Level.Trace] = LogLevel.Trace;
LevelMap[Level.Fatal] = LogMessageLevel.Fatal;
LevelMap[Level.Error] = LogMessageLevel.Error;
LevelMap[Level.Warn] = LogMessageLevel.Warning;
LevelMap[Level.Info] = LogMessageLevel.Info;
LevelMap[Level.Debug] = LogMessageLevel.Debug;
LevelMap[Level.Trace] = LogMessageLevel.Trace;
}

protected override void Append(LoggingEvent loggingEvent)
{
var level = LogLevel.Info;
var level = LogMessageLevel.Info;
if (LevelMap.ContainsKey(loggingEvent.Level))
{
level = LevelMap[loggingEvent.Level];
}

Log.Message(new Client.Requests.AddLogItemRequest
{
Level = level,
Time = loggingEvent.TimeStampUtc,
Text = RenderLoggingEvent(loggingEvent)
});
var logMessage = new LogMessage(RenderLoggingEvent(loggingEvent));
logMessage.Time = loggingEvent.TimeStampUtc;
logMessage.Level = level;

Context.Current.Log.Message(logMessage);
}
}
}
5 changes: 3 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

image: Visual Studio 2019

install:
- ps: gitversion /l console /output buildserver

Expand All @@ -7,7 +8,7 @@ configuration:

dotnet_csproj:
patch: true
version: '$(GitVersion_NuGetVersion)'
version: '$(GitVersion_SemVer)'

build_script:
- cmd: dotnet build
Expand Down

0 comments on commit 9139056

Please # to comment.