[Issue 14940] New: Can't call logger with more complex objects
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Aug 20 06:24:40 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14940
Issue ID: 14940
Summary: Can't call logger with more complex objects
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: dmdtracker at supradigital.org
I can't call the logger with any more complex objects. It used to work in the
older version in the dedicated repository before it was merged into phobos.
Example code:
import std.experimental.logger.filelogger;
import std.typecons: Nullable;
import std.stdio;
void main ( )
{
Nullable!int a = 1;
auto l = new FileLogger(stdout);
l.infof("log: %s", l);
}
Error:
phobos/std/experimental/logger/core.d(1121): Error: safe function
'std.experimental.logger.core.Logger.memLogFunctions!cast(LogLevel)cast(ubyte)64u.logImplf!(11,
"main.d", "main.main", "void main.main()", "main", FileLogger).logImplf' cannot
call system function 'std.format.formattedWrite!(MsgRange, char,
FileLogger).formattedWrite'
main.d(11): Error: template instance
std.experimental.logger.core.Logger.memLogFunctions!cast(LogLevel)cast(ubyte)64u.logImplf!(11,
"main.d", "main.main", "void main.main()", "main", FileLogger) error
instantiating
--
More information about the Digitalmars-d-bugs
mailing list