Home

How to print debug information to console with Xpand and Xtend1

This memo describes how to print debug information to the console with Xpand and Xtend1

During the development of Xpand templates and Xtend files it is sometimes useful to print information to the console. The Eclipse plugin org.eclipse.xtend.util.stdlib helps with this. To be able to print to the console just add the dependency

org.eclipse.xtend.util.stdlib

to your project like in the following figure.

Eclipse Dependency Manager

Afterwards Xpand files need the following line of code.

«EXTENSION org::eclipse::xtend::util::stdlib::io»

Xtend files need the following line of code.

extension org::eclipse::xtend::util::stdlib::io;

String doSomething(String str) :
info("HALLO") ->
collection.select( e | e.name == str)).first().info();

Date published:
Date modified: 2013-10-28
Keywords: Trench, Console, Xpand, Xtend