www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14940] New: Can't call logger with more complex objects


          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 puremagic.com
          Reporter: dmdtracker 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);


phobos/std/experimental/logger/core.d(1121): Error: safe function
"main.d", "main.main", "void main.main()", "main", FileLogger).logImplf' cannot
call system function 'std.format.formattedWrite!(MsgRange, char,
main.d(11): Error: template instance
"main.d", "main.main", "void main.main()", "main", FileLogger) error

Aug 20 2015