// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package logging.enhadhoc;

public class Test {
    public static int fac(int n) {
        int res;
        if (n <= 1) {
            res = 1;
        } else {
            res = n * fac(n - 1);
        }
        if(Logging.log) {
            Logging.dbg.println("fac : n = " + n + " res = " + res);
        }
        return res;
    }
    public static void main(String[] args) {
        Logging.log = true;
        Logging.dbg = System.err;
        System.out.println(fac(50));
    }
}
