lmajano
November 24, 2021, 3:17pm
1
If you are building Lucee Java extensions, what is the best way to provide logging that is consistent and in line with Lucee core. Do you have docs or examples on this?
sorry the the late reply, here’s a good example
import lucee.loader.engine.CFMLEngine;
import lucee.loader.engine.CFMLEngineFactory;
import lucee.runtime.PageContext;
import lucee.runtime.config.Config;
import lucee.runtime.type.Array;
public abstract class Coder {
private static Map<Long, Coder> instances = new ConcurrentHashMap<>();
protected Coder() {
}
public static Coder getInstance(PageContext pc) {
CFMLEngine eng = CFMLEngineFactory.getInstance();
StringBuilder sb = new StringBuilder();
Set<String> coders = CommonUtil.getCoders(sb, pc);
long hash = eng.getStringUtil().create64BitHash(sb.toString());
Coder instance = instances.get(hash);
1 Like