From 0f605cd78157e067d6bc63007ef7bf850edf8d80 Mon Sep 17 00:00:00 2001 From: "Jonas Merke [JJM]" Date: Tue, 9 Jan 2024 00:40:22 +0100 Subject: [PATCH] cleanup --- .../SlackSinkExample.cs | 4 +- .../jjm.one.MiscUtilFunctions.Tests.xml | 20 - ...log.Sinks.SlackWebHook.Example.SignKey.snk | Bin 0 -> 1172 bytes ....Serilog.Sinks.SlackWebHook.Example.csproj | 8 +- ...tionExtensionsConstructorParameterTests.cs | 6 +- .../SlackSinkLoggerTests.cs | 2 +- .../SlackSinkOptionsTests.cs | 2 +- .../jjm.one.MiscUtilFunctions.Tests.xml | 8 - ...rilog.Sinks.SlackWebHook.Tests.SignKey.snk | Bin 0 -> 1172 bytes ...ne.Serilog.Sinks.SlackWebHook.Tests.csproj | 14 +- .../SlackLoggerConfigurationExtensions.cs | 26 +- .../SlackSinkMessageTools.cs | 35 +- .../SlackSinkOptions.cs | 14 +- ...one.Serilog.Extensions.Logging.Helpers.xml | 526 ------------------ ...one.Serilog.Sinks.SlackWebHook.SignKey.snk | Bin 0 -> 1172 bytes .../jjm.one.Serilog.Sinks.SlackWebHook.csproj | 10 +- 16 files changed, 64 insertions(+), 611 deletions(-) delete mode 100644 src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.MiscUtilFunctions.Tests.xml create mode 100644 src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.Serilog.Sinks.SlackWebHook.Example.SignKey.snk delete mode 100644 src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.MiscUtilFunctions.Tests.xml create mode 100644 src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.Serilog.Sinks.SlackWebHook.Tests.SignKey.snk delete mode 100644 src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Extensions.Logging.Helpers.xml create mode 100644 src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.SignKey.snk diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/SlackSinkExample.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/SlackSinkExample.cs index a07709a..dd61400 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/SlackSinkExample.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/SlackSinkExample.cs @@ -7,12 +7,12 @@ namespace jjm.one.Serilog.Sinks.SlackWebHook.Example; /// -/// This class contains examples on how to use the library. +/// This class contains examples on how to use the library. /// public static class SlackSinkExample { /// - /// The main function of the class. + /// The main function of the class. /// /// /// diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.MiscUtilFunctions.Tests.xml b/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.MiscUtilFunctions.Tests.xml deleted file mode 100644 index 9f02b12..0000000 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.MiscUtilFunctions.Tests.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - jjm.one.Serilog.Sinks.SlackWebHook.Example - - - - - This class contains examples on how to use the library. - - - - - The main function of the class. - - - - - - diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.Serilog.Sinks.SlackWebHook.Example.SignKey.snk b/src/jjm.one.Serilog.Sinks.SlackWebHook.Example/jjm.one.Serilog.Sinks.SlackWebHook.Example.SignKey.snk new file mode 100644 index 0000000000000000000000000000000000000000..6450bd71ba15ff16ce94a0dda121193388893bfd GIT binary patch literal 1172 zcmV;F1Z(>T0ssI2Bme+XQ$aES2mk;90098ObtCOj^Go^O z^P20i)7&1B7?|9t(f4kR0fh={9AIJAJGu9ZEAeVlPVR#wz&0FZTKMTG-|z@p7WOwb zc3ulp&=AKPH`$xLLxGtX3)EVhq;kHn!YYSkn6sACAV#W`>s)YgTB45;-eHf^)_uU5 ztA(zYmt<+RaD3w3xk06@^GK`3txQ=lbV}~yZar#8qWD8C5_(lpI(t?mTZj|JR0k79 z8us;aM3ilhzy+NEW`KBPJ^t<^oKm8jN&+UyLsd?%=YHo86u47eJ?w~l4@=lDTJt|0 z_Ufa>a~lI=ZNZ9ayprva)XsCZgo>s$(6(5s2ox3Dn8P8Y6ooF`69xb#1>MuKPap0?>FFY|?8<4EoZ(VD>!?H>A&?l;($7l&T7T?I1?rr->VFJ7>IMilJb*s=GQ zY^2!YR`Gw6`_J}M1pPQL=&f))W0q@R3jw0gc>tI(?jJ!EO>_7>$E^+2R#UlYRg7Nh@n=jyv4 zp)EWN1a?6iZn7-Sks_`R8JM(1EG;{9WnZvXOVvvUs&@p!(+Fr6`0bF0qG7u)puoK# z{~cFxpXD){QF1C4(Dr$JzIRmEP*wyPIeCJM=(UZqjknYbHC^0}E)QoV z);veMKh!>-#b;H8-t`|**MK@4C`_wrPEQRo-KI(v&rrP4I9=4qc*0hNYC5`Llt2NB zfpcydV;P@wH9_A1fjPG_{UyD(-9|EfPtknres#I8f+tqUbk+cUJB*;D^5UO<6V_1+V3M$JLEyRmo#Dv3^gM$QW2L z>Uq$E@bG*w^?Fc!(ru155omKoH8;gz4yvZxDs1fVTYj8BtcySYh;*ByCHg6!U_xy; zpJ}y!vtpbPOtK&F@gV(X#Y|J+>xXEP(wg=4-eYbZ(L`qfj<%1mf#oFh_A8BU?eRx|iMpvVo1ud47GAyg@O#{*V}n1@%#@OW9NorPU9Y zV$n_Q7;LEgD=oHIRu`n9B;(bkQ$`FVX-Wu^>|Akerv^irYJB z+#nf2boD^axCe8`Z&yF@net8.0 disable enable - 2.1.2 + 2.1.3 Jonas Merkle [JJM] © by Jonas Merkle [JJM], 2024. jjm.one.Serilog.Sinks.SlackWebHook.Example @@ -15,19 +15,19 @@ https://github.com/jjm-one/jjm.one.Serilog.Sinks.SlackWebHook false false + true + jjm.one.Serilog.Sinks.SlackWebHook.Example.SignKey.snk latestmajor - ./jjm.one.MiscUtilFunctions.Tests.xml latestmajor - ./jjm.one.MiscUtilFunctions.Tests.xml - + diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackLoggerConfigurationExtensionsConstructorParameterTests.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackLoggerConfigurationExtensionsConstructorParameterTests.cs index b69cbf2..ab191ca 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackLoggerConfigurationExtensionsConstructorParameterTests.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackLoggerConfigurationExtensionsConstructorParameterTests.cs @@ -16,7 +16,7 @@ public void SetUp() { } - public const string ValidWebHook = @"https://slack.com/api/api.test"; + private const string ValidWebHook = @"https://slack.com/api/api.test"; [Test] public void SingleChannel_ConstructorTest_WebHookUrlNull() @@ -25,7 +25,7 @@ public void SingleChannel_ConstructorTest_WebHookUrlNull() { Log.Logger = new LoggerConfiguration() .WriteTo.Slack( - null, + null!, slackChannel: null ) .CreateLogger(); @@ -67,7 +67,7 @@ public void MultiChannel_ConstructorTest_WebHookUrlNull() { Log.Logger = new LoggerConfiguration() .WriteTo.Slack( - null, + null!, slackChannel: null ) .CreateLogger(); diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkLoggerTests.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkLoggerTests.cs index 521a529..9ff1234 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkLoggerTests.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkLoggerTests.cs @@ -22,7 +22,7 @@ public void SetUp() .CreateLogger(); } - public const string ValidWebHook = @"https://slack.com/api/api.test"; + private const string ValidWebHook = @"https://slack.com/api/api.test"; [Test] public void SingleChannel_LoggerTests_LogVerbose() diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkOptionsTests.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkOptionsTests.cs index 08b7f57..2d5d644 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkOptionsTests.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/SlackSinkOptionsTests.cs @@ -15,7 +15,7 @@ public void SetUp() public void DefaultConstructorTest() { var options = new SlackSinkOptions(); - + Assert.That(options.SlackAttachmentColors.Count == 6); Assert.That(options.SlackAttachmentFooterIcon.Count == 6); diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.MiscUtilFunctions.Tests.xml b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.MiscUtilFunctions.Tests.xml deleted file mode 100644 index 4e526d0..0000000 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.MiscUtilFunctions.Tests.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - jjm.one.Serilog.Sinks.SlackWebHook.Tests - - - - diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.Serilog.Sinks.SlackWebHook.Tests.SignKey.snk b/src/jjm.one.Serilog.Sinks.SlackWebHook.Tests/jjm.one.Serilog.Sinks.SlackWebHook.Tests.SignKey.snk new file mode 100644 index 0000000000000000000000000000000000000000..f57035de954587c00b05d5c938f2056a016495c9 GIT binary patch literal 1172 zcmV;F1Z(>T0ssI2Bme+XQ$aES2mk;90098QS2mumm=)+lKeZSNvekfpUN+T!#L5|L zgRSc!dRkt(K!5<&LtN>=dpm-r7D)L8ts^|Xg$P0!UfCoX{g=n-V6{rfa3=m1W9Fr` zL!b&_(QCdwWJ)6ct%Cen=8lua;=vB9r;pNQ59FZ$@|q$N*|+94{cQQ#>xbr6f}f)5 zNw*&>{ntLi;}7l$KO3mkH;*C#FfPh_DJ`zz$}|KR{flthP#JpXhmn%? zDu${h-Mj2F)ryXr3)`);Ke%fv%0jZRshxF|qn2QY|MLBIrBp}k&uK{yq11!Sd$r8j zY28E>BbDEAIH%htkVk=C7hyG*7bSwHsCXu<)b*^PRIZ=vpx=*+%6Kd?nagn;(3?${ z1NnsTp*nWyV)hxR*H&LEwY{3gTs4AFO&3KGaL zKqitYcEj6S^tCPCxPCplLXHuQ=$K!1_EfRV-zIU?jsue(_heA7by*LhORv6#pW&K+ z$-?d~FJL#`2Xo=G87=vVP|&p$5o;pcxkh#NS)8FvPsDx(C;b zl)|2u3M2CvbcoPvy#5y%d+OtD&Qmql&DN=Z8Z6}UlK=Rdy2EA18Wpi*`Tful{kUqKY(^AlaZy|H|9{S@Qg(*({wjHy0 z?3oivL0meYe6(BLiqY$LfN&I2kb#oZjv~s!EyK^`Cxfy+)IT=Gw00E>=f*VKnbL?L zx-tQTgGPg#dSp^D>PlG3tM3-Z2jUu1QU$;593JI6_G9_gsw?@e>SRFfa#KlbWo|}3 z^Axu=?YB{ZYQwUhoyqQf16b+BXKzR8Ebvh~u7bE^bqFo8!4pSG@$j>+t@%UIn2V{K zr^xX%I5wWPS})=&A1dSSu{d&`#H6=JZ;LNH9tb`kW!R<@+ru(WiFnCM(Dpf&A_B^lH*)Vz<6O5v - net8.0 + net8.0;net6.0 disable enable - 2.1.2 + 2.1.3 Jonas Merkle [JJM] © by Jonas Merkle [JJM], 2024. jjm.one.Serilog.Sinks.SlackWebHook.Tests @@ -15,25 +15,25 @@ https://github.com/jjm-one/jjm.one.Serilog.Sinks.SlackWebHook false true + true + jjm.one.Serilog.Sinks.SlackWebHook.Tests.SignKey.snk latestmajor - ./jjm.one.MiscUtilFunctions.Tests.xml latestmajor - ./jjm.one.MiscUtilFunctions.Tests.xml - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackLoggerConfigurationExtensions.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackLoggerConfigurationExtensions.cs index b3e59d0..07a88f5 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackLoggerConfigurationExtensions.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackLoggerConfigurationExtensions.cs @@ -19,6 +19,7 @@ public static class SlackLoggerConfigurationExtensions { #region private constructors +#pragma warning disable CS1584 // XML comment has syntactically incorrect cref attribute /// /// extension that provides configuration chaining. /// @@ -88,6 +89,7 @@ public static class SlackLoggerConfigurationExtensions /// A format provider (optional). /// A Switch to change the activation status of the sink on the fly (optional). /// Instance of object. +#pragma warning restore CS1584 // XML comment has syntactically incorrect cref attribute private static LoggerConfiguration Slack( this LoggerSinkConfiguration loggerSinkConfiguration, @@ -155,7 +157,8 @@ private static LoggerConfiguration Slack( if (slackThreadId is not null) slackSinkOptions.SlackThreadId = slackThreadId; if (slackAttachmentColors is not null) slackSinkOptions.SlackAttachmentColors = slackAttachmentColors; - if (slackAttachmentFooterIcon is not null) slackSinkOptions.SlackAttachmentFooterIcon = slackAttachmentFooterIcon; + if (slackAttachmentFooterIcon is not null) + slackSinkOptions.SlackAttachmentFooterIcon = slackAttachmentFooterIcon; if (slackAddShortInfoAttachment is not null) slackSinkOptions.SlackAddShortInfoAttachment = (bool)slackAddShortInfoAttachment; if (slackDisplayShortInfoAttachmentShort is not null) @@ -191,6 +194,7 @@ private static LoggerConfiguration Slack( #region public constructors +#pragma warning disable CS1584 // XML comment has syntactically incorrect cref attribute /// /// extension that provides configuration chaining. /// @@ -251,6 +255,7 @@ private static LoggerConfiguration Slack( /// A format provider (optional). /// A Switch to change the activation status of the sink on the fly (optional). /// Instance of object. +#pragma warning restore CS1584 // XML comment has syntactically incorrect cref attribute public static LoggerConfiguration Slack( this LoggerSinkConfiguration loggerSinkConfiguration, @@ -293,7 +298,7 @@ public static LoggerConfiguration Slack( ) { return Slack(loggerSinkConfiguration, slackWebHookUrl, slackUsername, slackEmojiIcon, slackUriIcon, - string.IsNullOrEmpty(slackChannel) ? null : new List { slackChannel }, slackDeleteOriginal, + string.IsNullOrEmpty(slackChannel) ? null : [slackChannel], slackDeleteOriginal, slackLinkNames, slackMarkdown, slackParseObj, slackReplaceOriginal, slackResponseType, slackThreadId, slackAttachmentColorsObj, slackAttachmentFooterIconObj, slackAddShortInfoAttachment, slackDisplayShortInfoAttachmentShort, slackAddExtendedInfoAttachment, @@ -304,6 +309,7 @@ public static LoggerConfiguration Slack( sinkOutputTemplate, sinkLevelSwitch, sinkFormatProvider, sinkActivationSwitch); } +#pragma warning disable CS1584 // XML comment has syntactically incorrect cref attribute /// /// extension that provides configuration chaining. /// @@ -367,6 +373,7 @@ public static LoggerConfiguration Slack( /// A format provider (optional). /// A Switch to change the activation status of the sink on the fly (optional). /// Instance of object. +#pragma warning restore CS1584 // XML comment has syntactically incorrect cref attribute public static LoggerConfiguration Slack( this LoggerSinkConfiguration loggerSinkConfiguration, @@ -428,15 +435,12 @@ public static LoggerConfiguration Slack( if (generateSlackFunctions is not null) { - if (generateSlackFunctions.Item1 is not null) - generateSlackMessageText = - (Func)generateSlackFunctions.Item1; - if (generateSlackFunctions.Item2 is not null) - generateSlackMessageAttachments = - (Func?>)generateSlackFunctions.Item2; - if (generateSlackFunctions.Item3 is not null) - generateSlackMessageBlocks = - (Func?>)generateSlackFunctions.Item3; + generateSlackMessageText = + (Func)generateSlackFunctions.Item1; + generateSlackMessageAttachments = + (Func?>)generateSlackFunctions.Item2; + generateSlackMessageBlocks = + (Func?>)generateSlackFunctions.Item3; } return Slack(loggerSinkConfiguration, slackWebHookUrl, slackUsername, slackEmojiIcon, slackUriIcon, diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs index 0424cc6..921563a 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs @@ -66,21 +66,22 @@ public static string GenerateSlackMessageText(LogEvent logEvent, IFormatProvider Color = slackSinkOptions.SlackAttachmentColors[logEvent.Level], Fallback = $"{logEvent.Timestamp.ToString(formatProvider)} [{logEvent.Level}] - {logEvent.RenderMessage()}", - Fields = new List - { - new() + Fields = + [ + new SlackField { Short = slackSinkOptions.SlackDisplayShortInfoAttachmentShort, Title = "Level", Value = logEvent.Level.ToString() }, - new() + + new SlackField { Short = slackSinkOptions.SlackDisplayShortInfoAttachmentShort, Title = "Timestamp", Value = logEvent.Timestamp.ToString(formatProvider) } - }, + ], Footer = null, FooterIcon = slackSinkOptions.SlackAttachmentFooterIcon[logEvent.Level], ImageUrl = null, @@ -160,40 +161,40 @@ public static string GenerateSlackMessageText(LogEvent logEvent, IFormatProvider Color = slackSinkOptions.SlackAttachmentColors[logEvent.Level], Fallback = $"{logEvent.Timestamp.ToString(formatProvider)} Exception: {logEvent.Exception.Message} \n {logEvent.Exception.StackTrace}", - Fields = new List - { - new() + Fields = + [ + new SlackField { Short = slackSinkOptions.SlackDisplayExceptionAttachmentShort, Title = "Message", Value = logEvent.Exception.Message }, - new() + + new SlackField { Short = slackSinkOptions.SlackDisplayExceptionAttachmentShort, Title = "Type", Value = $"`{logEvent.Exception.GetType().Name}`" }, - new() + + new SlackField { Short = false, Title = "Stack Trace", Value = $"```{logEvent.Exception.StackTrace}```" }, - new() + + new SlackField { Short = false, Title = "Exception", Value = $"```{logEvent.Exception}```" } - }, + ], Footer = null, FooterIcon = slackSinkOptions.SlackAttachmentFooterIcon[logEvent.Level], ImageUrl = null, - MarkdownIn = new List - { - "fields" - }, + MarkdownIn = ["fields"], Pretext = null, Text = null, ThumbUrl = null, @@ -207,7 +208,7 @@ public static string GenerateSlackMessageText(LogEvent logEvent, IFormatProvider #endregion - return attachments.Any() ? attachments : null; + return attachments.Any() ? attachments : null; } /// diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkOptions.cs b/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkOptions.cs index 946f789..9becc25 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkOptions.cs +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook/SlackSinkOptions.cs @@ -4,6 +4,8 @@ using Serilog.Events; using Slack.Webhooks; +// ReSharper disable RedundantDefaultMemberInitializer + namespace jjm.one.Serilog.Sinks.SlackWebHook; /// @@ -22,32 +24,32 @@ public class SlackSinkOptions #endregion - #region default values + #region private default values /// /// Default value for the OutputTemplate. /// - public const string DefaultOutputTemplate = "{Message:lj}"; + private const string DefaultOutputTemplate = "{Message:lj}"; /// /// Default value for the BatchSizeLimit. /// - public const int DefaultBatchSizeLimit = 10; + private const int DefaultBatchSizeLimit = 10; /// /// Default value for the Period. /// - public static readonly TimeSpan DefaultPeriod = TimeSpan.FromSeconds(2); + private static readonly TimeSpan DefaultPeriod = TimeSpan.FromSeconds(2); /// /// Default value for the QueueLimit. /// - public const int DefaultQueueLimit = 10000; + private const int DefaultQueueLimit = 10000; /// /// Default value for the Timeout. /// - public const int DefaultTimeout = 1000; + private const int DefaultTimeout = 1000; #endregion diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Extensions.Logging.Helpers.xml b/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Extensions.Logging.Helpers.xml deleted file mode 100644 index 86d2741..0000000 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Extensions.Logging.Helpers.xml +++ /dev/null @@ -1,526 +0,0 @@ - - - - jjm.one.Serilog.Sinks.SlackWebHook - - - - - This class contains the extenstion functions to add the Slack logger configuration to a existing logger - configuration. - - - - - extension that provides configuration chaining. - - Instance of object. - Slack WebHook URL. - Slack username (recommended). - Slack user-icon emoji string (optional). - Slack user-icon image URI (optional). - - A containing the name of all Slack channels in which the log - message should be posted (recommended). - - Slack message option 'DeleteOriginal' (optional). - Slack message option 'LinkNames' (optional). - Slack message option 'Markdown' (optional). - Slack message option 'Parse' as - Slack message option 'ReplaceOriginal' (optional). - Slack message option 'ResponseType' (optional). - Slack message option 'ThreadID' (optional). - - Slack message attachment color list as - (optional). - - - Slack message attachment footer icon list as - (optional). - - Add the short info attachment to the log message (optional). - Display the short info attachment in short form (optional). - Add the extended info attachment to the log message (optional). - Display the extended info attachment in short form (optional). - Add the short exception to the log message (optional). - Display the exception attachment in short form (optional). - Timeout for the connection to the Slack servers (optional). - The instance which the uses. - - A for message - text generation (optional). - - - A - message attachment list generation - (optional). - - - A for - message block list generation (optional). - - - Size of the batch of messages that get send at once to Slack - (recommended). - - Time period between sending of batches of messages (recommended). - - Maximum size of the queue that stores the messages before the - messages were send in batches to Slack (optional). - - - The absolute minimum a log message must have to - be send to Slack (optional). - - The template for the output format of the log messages (optional). - - A to change the minimum a - log message must have to be send to Slack (optional). - - A format provider (optional). - A Switch to change the activation status of the sink on the fly (optional). - Instance of object. - - - - extension that provides configuration chaining. - - Instance of object. - Slack WebHook URL (required). - Name of the Slack channel in which the log message should be posted (recommended). - Slack username (recommended). - Slack user-icon emoji string (recommended). - Slack user-icon image URI (optional). - Slack message option 'DeleteOriginal' (optional). - Slack message option 'LinkNames' (optional). - Slack message option 'Markdown' (optional). - Slack message option 'Parse' as - Slack message option 'ReplaceOriginal' (optional). - Slack message option 'ResponseType' (optional). - Slack message option 'ThreadID' (optional). - - Slack message attachment color list as - (optional). - - - Slack message attachment footer icon list as - (optional). - - Add the short info attachment to the log message (optional). - Display the short info attachment in short form (optional). - Add the extended info attachment to the log message (optional). - Display the extended info attachment in short form (optional). - Add the short exception to the log message (optional). - Display the exception attachment in short form (optional). - Timeout for the connection to the Slack servers (optional). - The instance which the uses. - - A - - containing custom functions [Item1 for message text generation, Item2 for message attachment list generation, Item3 - for message block list generation] for the Slack message generation (optional). - - - Size of the batch of messages that get send at once to Slack - (recommended). - - Time period between sending of batches of messages (recommended). - - Maximum size of the queue that stores the messages before the - messages were send in batches to Slack (optional). - - - The absolute minimum a log message must have to - be send to Slack (optional). - - The template for the output format of the log messages (optional). - - A to change the minimum a - log message must have to be send to Slack (optional). - - A format provider (optional). - A Switch to change the activation status of the sink on the fly (optional). - Instance of object. - - - - extension that provides configuration chaining. - - Instance of object. - Slack WebHook URL. - Slack username (recommended). - Slack user-icon emoji string (optional). - Slack user-icon image URI (optional). - - A containing the name of all Slack channels in which the log - message should be posted (recommended). - - Slack message option 'DeleteOriginal' (optional). - Slack message option 'LinkNames' (optional). - Slack message option 'Markdown' (optional). - Slack message option 'Parse' as - Slack message option 'ReplaceOriginal' (optional). - Slack message option 'ResponseType' (optional). - Slack message option 'ThreadID' (optional). - - Slack message attachment color list as - (optional). - - - Slack message attachment footer icon list as - (optional). - - Add the short info attachment to the log message (optional). - Display the short info attachment in short form (optional). - Add the extended info attachment to the log message (optional). - Display the extended info attachment in short form (optional). - Add the short exception to the log message (optional). - Display the exception attachment in short form (optional). - Timeout for the connection to the Slack servers (optional). - The instance which the uses. - - A - - containing custom functions [Item1 for message text generation, Item2 for message attachment list generation, Item3 - for message block list generation] for the Slack message generation (optional). - - - Size of the batch of messages that get send at once to Slack - (recommended). - - Time period between sending of batches of messages (recommended). - - Maximum size of the queue that stores the messages before the - messages were send in batches to Slack (optional). - - - The absolute minimum a log message must have to - be send to Slack (optional). - - The template for the output format of the log messages (optional). - - A to change the minimum a - log message must have to be send to Slack (optional). - - A format provider (optional). - A Switch to change the activation status of the sink on the fly (optional). - Instance of object. - - - - This class implements the for the use with slack as an endpoint. - - - - - Initializes new instance of . - - Slack Sink Options object. - FormatProvider object. - HttpClient instance. - GenerateSlackMessageText function. - GenerateSlackMessageAttachments function. - GenerateSlackMessageBlocks function. - A Switch to change the activation status of the sink on the fly (optional). - - - - instance for the SlackClient. - - - - - instance. - - - - - object for this Sink. - - - - - to change the activation status of the sink on the fly. - - - - - object. - - - - - Function to generate the text of the slack message. - - - - - Function to generate the attachments of the slack message. - - - - - Function to generate the blocks of the slack message. - - - - - Implements a function to close the and the - . - - - - - Implements and sends the with a - to Slack. - - A collection of . - An Awaitable Task. - - - - Implements . - - An Awaitable Task. - - - - This class provides functions for sending log events (serilog) to slack an implements therefor - . - - - - - Initializes new instance of . - - Slack Sink Options object. - FormatProvider object. - HttpClient instance. - GenerateSlackMessageText function. - GenerateSlackMessageAttachments function. - GenerateSlackMessageBlocks function. - A Switch to change the activation status of the sink on the fly (optional). - - - - Provides a switch to set a slack sink active or inactive on the fly. - - - - - Enum to represent an activation status. - - - - - deactivates the sink - - - - - activates the sink - - - - - The current status. - - - - - Initializes new instance of . - - The . - - - - Class with default tools for message generation. - - - - - DEFAULT GenerateSlackMessageText function. - - The log event. - A format provider - Sink Options as SlackSinkOptions. - The log message string. - - - - DEFAULT GenerateSlackMessageAttachments function. - - The log event. - A format provider - Sink Options as SlackSinkOptions. - The log message attachment list. - - - - DEFAULT GenerateSlackMessageBlocks function. - - The log event. - A format provider - Sink Options as SlackSinkOptions. - The log message block list. - - - - Class to contain all relevant options of this sink. - - - - - OPTIONAL: The template for the output format of the log messages. - - - - - Default value for the OutputTemplate. - - - - - Default value for the BatchSizeLimit. - - - - - Default value for the Period. - - - - - Default value for the QueueLimit. - - - - - Default value for the Timeout. - - - - - REQUIRED: Slack WebHook URL. - - - - - OPTIONAL: Timeout for the connection to the Slack servers. - - - - - RECOMMENDED: Slack username. - - - - - RECOMMENDED: Slack user-icon emoji string. - - - - - OPTIONAL: Slack user-icon image URI. - - - - - RECOMMENDED: A containing the name of all Slack channels in which the log message - should be posted. - - - - - OPTIONAL: Slack message option 'DeleteOriginal'. - - - - - OPTIONAL: Slack message option 'LinkNames'. - - - - - OPTIONAL: Slack message option 'Markdown'. - - - - - OPTIONAL: Slack message option 'Parse'. - - - - - OPTIONAL: Slack message option 'ReplaceOriginal'. - - - - - OPTIONAL: Slack message option 'ResponseType'. - - - - - OPTIONAL: Slack message option 'ThreadID'. - - - - - OPTIONAL: Slack message attachment color list as . - - - - - OPTIONAL: Slack message attachment footer icon list as . - - - - - OPTIONAL: Add the short info attachment to the log message. - - - - - OPTIONAL: Display the short info attachment in short form. - - - - - OPTIONAL: Add the extended info attachment to the log message. - - - - - OPTIONAL: Display the extended info attachment in short form. - - - - - OPTIONAL: Add the short exception to the log message. - - - - - OPTIONAL: Display the exception attachment in short form. - - - - - RECOMMENDED: Size of the batch of messages that get send at once to Slack. - - - - - RECOMMENDED: Time period between sending of batches of messages. - - - - - OPTIONAL: Maximum size of the queue that stores the messages before the messages were send in batches to Slack. - - - - diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.SignKey.snk b/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.SignKey.snk new file mode 100644 index 0000000000000000000000000000000000000000..02c858b75e4095c9cdb77a690ad8e05ca07e6994 GIT binary patch literal 1172 zcmV;F1Z(>T0ssI2Bme+XQ$aES2mk;90098Uywcc#w)*C{VcDn_|0B(e|2FA^fA%4x z(D0*9C#aU&gxPx9IenI_Z|PMuP&~%Vk%5)IcXqPr+cxk+G=%}EwKj^DCQ82dZ0B^w zYHf5f5}QhVh_&o|Z10PH9GB`N!CCa%(B9{Ua((X}lRkS}fkcm_|I5tU>rV9zh{4BFJ59ly^~y+!IwK*PKq|33T48$i`Z}rv)ow$shhdD}~#a#qa?ewpIRKd)Z!| z=KJqA!()Aq1r%&Q+L=>#`S>{`VCOJ^00@@x`^jF$@s*?l1|I9KGeFG0r5Lc zuqh3qEVD&{Yr4+C=oz^TrQw|c25n^VR1kBT(7A_klftR#Av|^`eD@st>xsmsm&6yBnvSUZuHj{WS z(O6&@2D7#`5sK+K0I-OxIGIk8-N?h)>G;lbe+{2@0%hW zE5wS&eq!F}?VJA4`qq#XHe%I*haUu-hl_}NfJLT)fu3oxbLR{$0K!+5Nn1A0?D&gK zFOxTAX-*!ZobK zhJIKTY<&ZIz-j1TMd{Iz+}dF*x?Nii{T?CT-Y>hLLUGbm!rFoeL5&(IbANMA{zGq`#!|KhL9lHN1c>2?`L|>`BEm&!Z z(rAlIdU67gvjmR3>k1~LzL=U!Y<#}Ur%&Ht9H*DMwudMIfnH^2kbd4R?14)HNy=9d zLl+++ubw%-^ETMUOE3toaD_n-)gw8C#%!`C{0RDD6v)9FOsS@&zkn{&<$I8xT08%ukCD{G0ob^c6| z?7%IKe(W^wDNS{qu!a+~yVGmc3}J?UqxNP~>m==)5M}4A3j-4w;}3io77o0sSU}_i zqmz!Vl~8|-24JNANx3240S3hpDkN_3(6z?-b1Oy4t_{%ukAQa`$BYn*Yt=1(Jf3TW z>GqZe{V?TLZJri2=ku~km1gxl;@Ibde1^UL=n~1y>^~;xW|eW=O|?h}6JR93SgAL$6R?_5-hA)9 mbD9AQuOkNY8k_DCq{6-IIoNaP+*=CE8XNJ(8a&TW(j^%$=To`> literal 0 HcmV?d00001 diff --git a/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.csproj b/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.csproj index 5a00581..fc0bfc9 100644 --- a/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.csproj +++ b/src/jjm.one.Serilog.Sinks.SlackWebHook/jjm.one.Serilog.Sinks.SlackWebHook.csproj @@ -1,10 +1,10 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0 + net6.0;net8.0;netstandard2.0;netstandard2.1 disable enable - 2.1.2 + 2.1.3 Jonas Merkle [JJM] © by Jonas Merkle [JJM], 2024. jjm.one.Serilog.Sinks.SlackWebHook @@ -18,15 +18,15 @@ LICENSE True True + true + jjm.one.Serilog.Sinks.SlackWebHook.SignKey.snk latestmajor - .\jjm.one.Serilog.Extensions.Logging.Helpers.xml latestmajor - .\jjm.one.Serilog.Extensions.Logging.Helpers.xml @@ -40,7 +40,7 @@ - +