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

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Test {
    private static final Log log = LogFactory.getLog(Test.class);
    public static int fac(int n) {
        int res;
        if (n <= 1) {
            res = 1;
        } else {
            res = n * fac(n - 1);
        }
        if(log.isDebugEnabled()) {
            log.debug("fac : n = " + n + " res = " + res);
        }
        return res;
    }
    public static void main(String[] args) {
        log.info("Start");
        System.out.println(fac(50));
        log.info("End");
    }
}
