digitalmars.D.learn - Customization of User Defined Logger
- Suliman (23/23) Jul 19 2015 When I try co compile next code:
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (6/13) Jul 19 2015 According to (and despite :p) its documentation Logger's constructor
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
Jul 19 2015
On 07/19/2015 06:02 AM, Suliman wrote:When I try co compile next code: class MyCustomLogger : Logger { this(string newName, LogLevel lv) safe { super(newName, lv);According to (and despite :p) its documentation Logger's constructor takes just a LogLevel:If I am write I think that this example should be extended.The documentation needs some help. :) Ali
Jul 19 2015








=?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com>