Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,093 changes: 4,093 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions .github/workflows/package-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
PROJECT_NAME: FluffyVoid.Logging
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -29,8 +30,8 @@ jobs:

- name: Build and Package project
run: |
cd Logging
cd ${{ env.PROJECT_NAME }}
dotnet pack -c Release -o out

- name: Push generated package to GitHub registry
run: dotnet nuget push ./Logging/out/*.nupkg -k ${{ env.NUGET_AUTH_TOKEN }} -s ${{ env.REPOSITORY_URL }} --skip-duplicate --no-symbols
run: dotnet nuget push ./${{ env.PROJECT_NAME }}/out/*.nupkg -k ${{ env.NUGET_AUTH_TOKEN }} -s ${{ env.REPOSITORY_URL }} --skip-duplicate --no-symbols
2 changes: 1 addition & 1 deletion Logging.sln → FluffyVoid.Logging.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logging", "Logging\Logging.csproj", "{C7F880B2-7B68-4515-AD17-775A2F8F435E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluffyVoid.Logging", "FluffyVoid.Logging\FluffyVoid.Logging.csproj", "{C7F880B2-7B68-4515-AD17-775A2F8F435E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
449 changes: 449 additions & 0 deletions FluffyVoid.Logging.sln.DotSettings

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>FluffyVoid.Logging</PackageId>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
<Title>FluffyVoid.Logging</Title>
<Authors>FluffyVoid</Authors>
<Description>Thread-safe log manager that can log simultaneously to multiple log targets.</Description>
<Company>FluffyVoid</Company>
<Product>FluffyVoid.Logging</Product>
<AssemblyVersion>1.0.2</AssemblyVersion>
<FileVersion>1.0.2</FileVersion>
<AssemblyVersion>1.0.3</AssemblyVersion>
<FileVersion>1.0.3</FileVersion>
<TargetFramework>netstandard2.1</TargetFramework>
<RepositoryUrl>https://github.com/ashiryn/Logging</RepositoryUrl>
<LangVersion>latestmajor</LangVersion>
Expand Down
2 changes: 2 additions & 0 deletions FluffyVoid.Logging/FluffyVoid.Logging.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=loghelpers/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
57 changes: 57 additions & 0 deletions FluffyVoid.Logging/LogHelpers/Command.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace FluffyVoid.Logging
{
public partial class LogManager
{
/// <summary>
/// Logs out a command message to all registered log targets
/// </summary>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogCommand(object message,
string source,
string color = "",
Exception? ex = null)
{
Log(GetLogInformation<LogInformation>(
message, source, color, Severity.Command, ex));
}
/// <summary>
/// Logs out a command message to all registered log targets except for the
/// specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to exclude from logging to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogCommandExcluding<T>(
object message,
string source,
string color = "",
Exception? ex = null)
{
LogExcluding(
GetLogInformation<LogInformation>(
message, source, color, Severity.Command, ex), typeof(T));
}
/// <summary>
/// Logs out a command message to the specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to solely log to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogCommandTo<T>(object message,
string source,
string color = "",
Exception? ex = null)
{
LogTo(
GetLogInformation<LogInformation>(
message, source, color, Severity.Command, ex), typeof(T));
}
}
}
57 changes: 57 additions & 0 deletions FluffyVoid.Logging/LogHelpers/Critical.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace FluffyVoid.Logging
{
public partial class LogManager
{
/// <summary>
/// Logs out a critical message to all registered log targets
/// </summary>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogCritical(object message,
string source,
string color = "",
Exception? ex = null)
{
Log(GetLogInformation<LogInformation>(
message, source, color, Severity.Critical, ex));
}
/// <summary>
/// Logs out a critical message to all registered log targets except for the
/// specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to exclude from logging to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogCriticalExcluding<T>(
object message,
string source,
string color = "",
Exception? ex = null)
{
LogExcluding(
GetLogInformation<LogInformation>(
message, source, color, Severity.Critical, ex), typeof(T));
}
/// <summary>
/// Logs out a critical message to the specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to solely log to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogCriticalTo<T>(object message,
string source,
string color = "",
Exception? ex = null)
{
LogTo(
GetLogInformation<LogInformation>(
message, source, color, Severity.Critical, ex), typeof(T));
}
}
}
57 changes: 57 additions & 0 deletions FluffyVoid.Logging/LogHelpers/Error.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace FluffyVoid.Logging
{
public partial class LogManager
{
/// <summary>
/// Logs out an error message to all registered log targets
/// </summary>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogError(object message,
string source,
string color = "",
Exception? ex = null)
{
Log(GetLogInformation<LogInformation>(
message, source, color, Severity.Error, ex));
}
/// <summary>
/// Logs out an error message to all registered log targets except for the
/// specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to exclude from logging to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogErrorExcluding<T>(
object message,
string source,
string color = "",
Exception? ex = null)
{
LogExcluding(
GetLogInformation<LogInformation>(
message, source, color, Severity.Error, ex), typeof(T));
}
/// <summary>
/// Logs out an error message to the specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to solely log to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogErrorTo<T>(object message,
string source,
string color = "",
Exception? ex = null)
{
LogTo(
GetLogInformation<LogInformation>(
message, source, color, Severity.Error, ex), typeof(T));
}
}
}
57 changes: 57 additions & 0 deletions FluffyVoid.Logging/LogHelpers/Exception.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace FluffyVoid.Logging
{
public partial class LogManager
{
/// <summary>
/// Logs out an exception message to all registered log targets
/// </summary>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
// ReSharper disable once MemberCanBePrivate.Global
public static void LogException(object message,
string source,
string color = "",
Exception? ex = null)
{
Log(GetLogInformation<LogInformation>(
message, source, color, Severity.Exception, ex));
}
/// <summary>
/// Logs out an exception message to all registered log targets except for the
/// specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to exclude from logging to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogExceptionExcluding<T>(object message,
string source,
string color = "",
Exception? ex = null)
{
LogExcluding(
GetLogInformation<LogInformation>(
message, source, color, Severity.Exception, ex), typeof(T));
}
/// <summary>
/// Logs out an exception message to the specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to solely log to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogExceptionTo<T>(object message,
string source,
string color = "",
Exception? ex = null)
{
LogTo(
GetLogInformation<LogInformation>(
message, source, color, Severity.Exception, ex), typeof(T));
}
}
}
57 changes: 57 additions & 0 deletions FluffyVoid.Logging/LogHelpers/Fatal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace FluffyVoid.Logging
{
public partial class LogManager
{
/// <summary>
/// Logs out a fatal message to all registered log targets
/// </summary>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogFatal(object message,
string source,
string color = "",
Exception? ex = null)
{
Log(GetLogInformation<LogInformation>(
message, source, color, Severity.Fatal, ex));
}
/// <summary>
/// Logs out a fatal message to all registered log targets except for the
/// specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to exclude from logging to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogFatalExcluding<T>(
object message,
string source,
string color = "",
Exception? ex = null)
{
LogExcluding(
GetLogInformation<LogInformation>(
message, source, color, Severity.Fatal, ex), typeof(T));
}
/// <summary>
/// Logs out a fatal message to the specified log target
/// </summary>
/// <typeparam name="T">The type of the log target to solely log to</typeparam>
/// <param name="message">The message to log out</param>
/// <param name="source">The source value to assign to the log message</param>
/// <param name="color">The color to assign to the log message</param>
/// <param name="ex">The exception to assign to the log message</param>
public static void LogFatalTo<T>(object message,
string source,
string color = "",
Exception? ex = null)
{
LogTo(
GetLogInformation<LogInformation>(
message, source, color, Severity.Fatal, ex), typeof(T));
}
}
}
Loading
Loading