Logging
Muhammad Xodjayev
ILogger nima?
using Microsoft.Extensions.Logging
public class MyService(ILogger<MyService> logger)
{
public void DoWork()
{
logger.LogInformation("Doing work at {Time}", DateTime.UtcNow);
}
}Logging levels (Qayd qilishning darajalari)
Trace
Debug
Information
Warning
Error
Critical
Qayd qilishni sozlash
Diqqat!
Diqqat #2
Shu Log (qayd) qilishlarni yaxshilab o’rganib olsak, anchagina debug-friendly (debug qilishga oson bo’lgan) dasturlarni qura olamiz.
Last updated
Was this helpful?