JohnReedLOL / scala-trace-debug

Macro based print debugging. Locates log statements in your IDE.
https://github.com/JohnReedLOL/pos
MIT License
115 stars 5 forks source link

Macro.codeOut is printing to standard err #21

Closed JohnReedLOL closed 8 years ago

JohnReedLOL commented 8 years ago

this...

    def traceLinesCodeImpl(c: Compat.Context)(toPrint: c.Expr[Any], numLines: c.Expr[Int]): c.Expr[String] = {
      import c.universe._
      val blockString = (new MacroHelperMethod[c.type](c)).getSourceCode(toPrint.tree)
      val arg1 = q""" "(" + $blockString + ") -> " + ({$toPrint}.toString) """
      val arg2 = q"$numLines"
      val args: List[c.universe.Tree] = List(arg1, arg2)
      val toReturn =
        q"""
        _root_.scala.trace.Debug.err(..$args);
      """
      c.Expr[String](toReturn)
    }

should say " root.scala.trace.Debug.out(..$args);"