From d21a0e176a944313909196ca3df9ea6c830dd0d9 Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Mon, 16 Dec 2024 15:36:47 -0500 Subject: [PATCH] add some logging to the hub --- NoteHub.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NoteHub.cs b/NoteHub.cs index 5e84bbc..5aff2f7 100644 --- a/NoteHub.cs +++ b/NoteHub.cs @@ -8,10 +8,12 @@ namespace BinaryDad.Notes public class NoteHub : Hub { private readonly INoteService noteService; + private readonly ILogger logger; - public NoteHub(INoteService noteService) + public NoteHub(INoteService noteService, ILogger logger) { this.noteService = noteService; + this.logger = logger; } public override Task OnConnectedAsync() @@ -25,6 +27,8 @@ namespace BinaryDad.Notes public async Task SaveNote(string content, string noteName) { + logger.LogInformation($"Saving note \"{noteName}\""); + noteService.SaveNote(content, noteName); // find all other connections except for the current one