--main.d
import test;
int main( char[][] args ) {
logger!("hoge").test();
return 0;
}
--test.d
import std.stdio;
template logger( string s, string file = __FILE__, int line = __LINE__ ) {
void test() {
writefln( "%s %s %d",s, file, line );
}
}
--実行結果
hoge test.d 4

(´・ω・`)