fix hard code of fastjson KeyConvertor
@@ -3,7 +3,6 @@ package com.alicp.jetcache;
import com.alicp.jetcache.embedded.AbstractEmbeddedCache;
import com.alicp.jetcache.event.*;
import com.alicp.jetcache.external.AbstractExternalCache;
-import com.alicp.jetcache.support.FastjsonKeyConvertor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,9 +44,16 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
sb.append("jetcache(")
.append(this.getClass().getSimpleName()).append(") ")
.append(oper)
- .append(" error. key=")
- .append(FastjsonKeyConvertor.INSTANCE.apply(key))
- .append(".");
+ .append(" error.");
+ if (!(key instanceof byte[])) {
+ try {
+ sb.append(" key=[")
+ .append(config().getKeyConvertor().apply((K) key))
+ .append(']');
+ } catch (Exception ex) {
+ // ignore
+ }
+ }
if (needLogStackTrace(e)) {
logger.error(sb.toString(), e);
} else {
