When I try co compile next code:

class MyCustomLogger : Logger
{
    this(string newName, LogLevel lv) @safe
    {
        super(newName, lv);
    }

    override void writeLogMsg(ref LogEntry payload)
    {
        // log message in my custom way
    }
}

auto logger = new MyCustomLogger();
logger.log("Awesome log message");

I am getting error:
logger.d(10): Error: constructor std.experimental.logger.core.Logger.this (LogLe
vel lv) is not callable using argument types (string, LogLevel)
logger.d(19): Error: undefined identifier lv

it's seems that I need to pass to constructor path with type string and LogLevel lv. But what it is?

If I am write I think that this example should be extended.


[1] http://dlang.org/library/std/experimental/logger.html

Reply via email to