Skip to content

Commit

Permalink
Switched to generic logger class
Browse files Browse the repository at this point in the history
  • Loading branch information
umerfaruk committed Sep 12, 2024
1 parent a9cdcaf commit dfeecaa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/RekhtaDownloader.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ private static async Task DownloadBook(string bookUrl, int taskCount, OutputType
{
//var bookUrl = "https://rekhta.org/ebooks/alfaz-shumara-number-000-jameel-akhtar-magazines-7/";

await new BookExporter(LoggingFactory.CreateLogger<BookExporter>())
await new BookExporter(LoggingFactory.CreateLogger(nameof(RekhtaDownloader)))
.DownloadBook(bookUrl, taskCount, outputType, null, token);
}

private static async Task GetBookInfo(string bookUrl, CancellationToken token)
{
//var bookUrl = "https://www.rekhta.org/ebooks/detail/patras-ke-mazameen-patras-bukhari-ebooks-2?lang=ur";
var logger = LoggingFactory.CreateLogger<BookExporter>();
var logger = LoggingFactory.CreateLogger(nameof(RekhtaDownloader));
var bookInfo = await new BookExporter(logger).GetBookInformation(bookUrl, token);
if (bookInfo != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/RekhtaDownloader.Tests/IntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public class IntegrationTest
[TestMethod]
public async Task TestDownload()
{
var logger = LoggingFactory.CreateLogger<BookExporter>();
var logger = LoggingFactory.CreateLogger(nameof(IntegrationTest));
var downloader = new BookExporter(logger);
var outputPath = await downloader.DownloadBook("https://www.rekhta.org/ebooks/rafeeq-e-manzil-shumara-number-10-magazines", 10, OutputType.Pdf);
}

[TestMethod]
public async Task TestGetInformation()
{
var logger = LoggingFactory.CreateLogger<BookExporter>();
var logger = LoggingFactory.CreateLogger(nameof(IntegrationTest));
var downloader = new BookExporter(logger);
var bookInfo= await downloader.GetBookInformation("https://www.rekhta.org/ebooks/sarguzisht-abdul-majeed-salik-ebooks-1");
Assert.IsNotNull(bookInfo);
Expand Down
4 changes: 2 additions & 2 deletions src/RekhtaDownloader/BookExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace RekhtaDownloader
{
public class BookExporter
{
private readonly ILogger<BookExporter> _logger;
private readonly ILogger _logger;

public BookExporter(ILogger<BookExporter> logger)
public BookExporter(ILogger logger)
{
_logger = logger;
}
Expand Down

0 comments on commit dfeecaa

Please sign in to comment.