GIS Converter Logging -Code

Dani_S 5,176 Reputation points
2025-12-16T18:46:48.4766667+00:00

Hi Michel,

1.Can you please look on my Logger implementations and tests ?

2.If you find something missing , can you give me the fixes ?

3.Files

Console.App -Client

GitConverter ConsoleApp README.txt

Program.cs.txt

Logging code

README.md.txt

IAppLogger.cs.txt

Log.cs.txt

LogHelper.cs.txt

LogHelper.cs.txt

NullLogger.cs.txt

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Answer accepted by question author
  1. Michael Le (WICLOUD CORPORATION) 7,700 Reputation points Microsoft External Staff Moderator
    2025-12-17T10:11:20.6833333+00:00

    Hello @Dani_S ,

    I've reviewed your updated program. There are a few issues you should address:

    Typo in debug configuration

    You have a typo in the EnsureDebugArgs method that will cause failures:

    case "shapefile1":
        return new[]
        {
            "gis_convert",
            @"D:\GisConverter\Tests\Shapefile\Input\ShapeFiles. 7z",
            "Shapefille",  // should be "Shapefile"
    

    Argument count validation is incorrect

    Your minimum argument check requires 6 arguments but you actually only need 5:

    if (args.Length < 6)  // should be 5
    {
        Console.WriteLine("usage: gis_convert <input> <format> <output> <temp> [Log <log_path> [level]]");
        return (int)ExitCode.AppError;
    }
    
    

    The command structure is: gis_convert (0), input (1), format (2), output (3), temp (4) - that's 5 required arguments. Logging is optional. Change this to:

    if (args.Length < 5)
    {
        Console.WriteLine("usage: gis_convert <input> <format> <output> <temp> [Log <log_path> [level]]");
        return (int)ExitCode.AppError;
    }
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.