-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* optimization, logging source generators * update dependencies --------- Co-authored-by: AoshiW <ondru@SHIRO-V3> Co-authored-by: AoshiW <[email protected]>
- Loading branch information
1 parent
f833b1a
commit d0c32b5
Showing
6 changed files
with
117 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.Extensions.Logging; | ||
using System; | ||
|
||
namespace TwitchLib.PubSub.Extensions | ||
{ | ||
internal static partial class LoggingExtesions | ||
{ | ||
[LoggerMessage(LogLevel.Error, "OnError in PubSub Websocket connection occured! Exception: {ex}")] | ||
public static partial void LogOnError(this ILogger<TwitchPubSub> logger, Exception ex); | ||
|
||
[LoggerMessage(LogLevel.Debug, "Received Websocket OnMessage: {message}")] | ||
public static partial void LogReceivednMessage(this ILogger<TwitchPubSub> logger, string message); | ||
|
||
[LoggerMessage(LogLevel.Warning, "PubSub Websocket connection closed")] | ||
public static partial void LogConnectionClosed(this ILogger<TwitchPubSub> logger); | ||
|
||
[LoggerMessage(LogLevel.Information, "PubSub Websocket connection established")] | ||
public static partial void LogConnectionEstablished(this ILogger<TwitchPubSub> logger); | ||
|
||
[LoggerMessage(LogLevel.Information, "[TwitchPubSub] {message}")] | ||
public static partial void LogUnaccountedFor(this ILogger<TwitchPubSub> logger, string message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace TwitchLib.PubSub.Models | ||
{ | ||
internal class Request | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("nonce")] | ||
public string Nonce { get; set; } | ||
|
||
[JsonProperty("data")] | ||
public RequestData Data { get; set; } | ||
} | ||
|
||
internal class RequestData | ||
{ | ||
[JsonProperty("topics")] | ||
public List<string> Topics { get; set; } | ||
|
||
[JsonProperty("auth_token", NullValueHandling = NullValueHandling.Ignore)] | ||
public string AuthToken { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters