Skip to content

Commit

Permalink
Fix Logger static constructor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bbepis committed Jan 24, 2021
1 parent cdc8ec5 commit a28aefb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions BepInEx.Core/Logging/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;

namespace BepInEx.Logging
Expand All @@ -8,17 +8,25 @@ namespace BepInEx.Logging
/// </summary>
public static class Logger
{
private static readonly ManualLogSource InternalLogSource = CreateLogSource("BepInEx");
private static readonly ManualLogSource InternalLogSource;

/// <summary>
/// Collection of all log listeners that receive log events.
/// </summary>
public static ICollection<ILogListener> Listeners { get; } = new List<ILogListener>();
public static ICollection<ILogListener> Listeners { get; }

/// <summary>
/// Collection of all log source that output log events.
/// </summary>
public static ICollection<ILogSource> Sources { get; } = new LogSourceCollection();
public static ICollection<ILogSource> Sources { get; }

static Logger()
{
Sources = new LogSourceCollection();
Listeners = new List<ILogListener>();

InternalLogSource = CreateLogSource("BepInEx");
}

internal static void InternalLogEvent(object sender, LogEventArgs eventArgs)
{
Expand Down

0 comments on commit a28aefb

Please sign in to comment.