add some logging to the hub
This commit is contained in:
parent
f69d19100d
commit
d21a0e176a
@ -8,10 +8,12 @@ namespace BinaryDad.Notes
|
||||
public class NoteHub : Hub
|
||||
{
|
||||
private readonly INoteService noteService;
|
||||
private readonly ILogger<NoteHub> logger;
|
||||
|
||||
public NoteHub(INoteService noteService)
|
||||
public NoteHub(INoteService noteService, ILogger<NoteHub> 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user