本文整理了Java中com.holonplatform.core.internal.Logger
类的一些代码示例,展示了Logger
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger
类的具体详情如下:
包路径:com.holonplatform.core.internal.Logger
类名称:Logger
[英]Logger service.
[中]记录器服务。
代码示例来源:origin: com.holon-platform.core/holon-core
/**
* Optional id to distinguish this datastore data context between multiple avaialable contexts
* @param dataContextId Data context id
*/
public void setDataContextId(String dataContextId) {
this.dataContextId = dataContextId;
LOGGER.debug(() -> "Datastore [" + this + "]: setted data context id [" + dataContextId + "]");
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
@Override
public Optional<PropertyBox> getItem(T value) {
if (toItemConverter != null) {
return toItemConverter.apply(value);
}
LOGGER.warn(
"The value to PropertyBox item conversion logic was not configured, no item will never be returned");
return Optional.empty();
}
代码示例来源:origin: com.holon-platform.core/holon-core
/**
* Get a {@link Logger} bound to {@link #NAME}.
* @return Logger
*/
static Logger create() {
return Logger.create(NAME);
}
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-core
@Override
public void trace(final String title, final Supplier<String> json) {
if (isTraceEnabled()) {
LOGGER.info("(TRACE) " + ((title != null) ? title : "JSON") + ": \n" + json.get());
} else {
LOGGER.debug(() -> ((title != null) ? title : "JSON") + ": \n" + json.get());
}
}
代码示例来源:origin: com.holon-platform.core/holon-core
: ClassUtils.getDefaultClassLoader();
LOGGER.debug(() -> "Load DatastoreCommodityFactory for classloader [" + cl
+ "] using ServiceLoader with service name: " + commodityFactoryType.getName());
if (!commodities.containsKey(commodityType)) {
commodities.put(commodityType, f);
LOGGER.debug(() -> "Registered commodity factory [" + f.getClass().getName()
+ "] bound to commodity type [" + commodityType.getName() + "]");
LOGGER.warn("Invalid commodity factory [" + f.getClass().getName() + "]: the commodity type "
+ "returned by getCommodityType() is null - skipping factory registration");
代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin-spring
if (beanNames != null && beanNames.length > 0) {
if (beanNames.length > 1) {
LOGGER.warn("More than one bean annotated with @DefaultView was found in context " + "("
+ beanNames.length + "), no default view will be configured in Navigator.");
} else {
if (viewName != null) {
getActuator().setDefaultViewName(viewName);
LOGGER.info("Configured default view " + type.getName() + " with name: " + viewName);
if (beanNames != null && beanNames.length > 0) {
if (beanNames.length > 1) {
LOGGER.warn("More than one bean annotated with @ErrorView was found in context " + "("
+ beanNames.length + "), no error view will be configured in Navigator.");
} else {
LOGGER.info("Configured error view: " + type.getName());
if (beanNames != null && beanNames.length > 0) {
if (beanNames.length > 1) {
LOGGER.warn("More than one bean annotated with @AccessDeniedView was found in context "
+ "(" + beanNames.length
+ "), no access denied view will be configured in Navigator.");
LOGGER.info("Configured access denied view: " + type.getName());
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-async
LOGGER.debug(() -> "MongoDB transaction [" + tx + "] was not finalized because it is not new");
return CompletableFuture.completedFuture(Boolean.FALSE);
LOGGER.error("Failed to finalize the transaction", e);
return null;
}).thenApply(r -> {
LOGGER.debug(() -> "MongoDB transaction [" + tx + "] finalized");
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-sync
@Override
protected void onDatastoreInitialized(ClassLoader classLoader) {
LOGGER.info("MongoDB SYNC Datastore initialized [Database name: " + getDatabaseName()
+ getDataContextId().map(id -> ", Data context id: " + id).orElse("") + "]");
}
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow
windowSizeReceiver);
} catch (Exception e) {
LOGGER.error("Failed to execute window size detection JS [" + e.getMessage() + "]");
LOGGER.warn(
"The UI reference is not available, the browser window width and height won't be detected and updated");
代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin
@Override
public Result<PropertyBox> convertToModel(T value, ValueContext context) {
try {
return Result.ok(itemConverter.convert(value));
} catch (Exception e) {
LOGGER.error("Conversion to model failed", e);
return Result.error(e.getMessage());
}
}
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-core
/**
* Get the Mongo driver version informations.
* @param classLoader ClassLoader to use (not null)
* @return Mongo driver version informations
*/
public static MongoVersion getMongoVersion(ClassLoader classLoader) {
ObjectUtils.argumentNotNull(classLoader, "ClassLoader must be not null");
return MONGO_VERSIONS.computeIfAbsent(classLoader, cl -> {
try {
final Class<?> cls = ClassUtils.forName("com.mongodb.internal.build.MongoDriverVersion", cl);
final Field fld = cls.getDeclaredField("VERSION");
Object value = fld.get(null);
if (value != null && value instanceof String) {
return new DefaultMongoVersion(true, (String) value);
}
} catch (Exception e) {
LOGGER.warn("Failed to detect Mongo driver version");
LOGGER.debug(() -> "Failed to detect Mongo driver version using MongoDriverVersion class", e);
}
return new DefaultMongoVersion(false, null);
});
}
代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin-spring
LOGGER.info("SpringViewClassProvider: Detecting View classes");
final String[] viewBeanNames = applicationContext.getBeanNamesForAnnotation(SpringView.class);
for (String beanName : viewBeanNames) {
if (uis.length == 0) {
viewClasses.put(viewName, new WeakReference<>(viewType));
LOGGER.debug(() -> "View class [" + viewType + "] detected for the view name [" + viewName
+ "]");
} else {
uiViewClasses.computeIfAbsent(ui, key -> new HashMap<>()).put(viewName,
new WeakReference<>(viewType));
LOGGER.debug(() -> "View class [" + viewType + "] detected for the view name ["
+ viewName + "] - bound to the UI class [" + ui + "]");
代码示例来源:origin: com.holon-platform.jpa/holon-datastore-jpa-spring
.withPropertySource(EnvironmentConfigPropertyProvider.create(environment)).build();
} catch (Exception e) {
logger.warn("Failed to load DatastoreConfigProperties", e);
wrn.append(": expecting a persistence.xml file for unit name: ");
wrn.append(dataContextId);
logger.warn(wrn.toString());
logger.info(log.toString());
log.append("\"");
logger.info(log.toString());
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-async
@Override
protected void onDatastoreInitialized(ClassLoader classLoader) {
LOGGER.info("MongoDB ASYNC Datastore initialized [Database name: " + getDatabaseName()
+ getDataContextId().map(id -> ", Data context id: " + id).orElse("") + "]");
}
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-core
/**
* Get the API response.
* @param application JAX-RS Application reference
* @param headers JAX-RS Headers reference
* @param uriInfo JAX-RS URI info reference
* @param outputType API definition output type
* @return The API response
*/
protected Response getApi(Application application, HttpHeaders headers, UriInfo uriInfo, OutputType outputType) {
// API context id
final String contextId = getContextIdOrDefault();
try {
// get the API definition
final ApiDefinition<M> api = getApi(contextId, application, headers, uriInfo);
// check not null
if (api.getApi() == null) {
return Response.status(Status.NOT_FOUND)
.entity("No API definition available for context id [" + contextId + "]").build();
}
// serialize the API definition
return Response.status(Response.Status.OK).type(outputType.getMediaType())
.entity(getApiOutput(outputType, api.getApi(), api.isPretty())).build();
} catch (Exception e) {
LOGGER.error("Failed to provide the API definition for context id [" + contextId + "]", e);
return Response.status(Status.INTERNAL_SERVER_ERROR)
.entity("Failed to provide the API definition for context id [" + contextId + "] - Error: ["
+ ExceptionUtils.getRootCauseMessage(e) + "]")
.build();
}
}
代码示例来源:origin: com.holon-platform.core/holon-core
/**
* Set whether to trace Datastore operations.
* @param trace Whether to trace Datastore operations
*/
public void setTraceEnabled(boolean trace) {
this.traceEnabled = trace;
LOGGER.debug(() -> "Datastore [" + this + "]: setted trace enabled [" + trace + "]");
}
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-sync
LOGGER.warn("A thread bound transaction was already present [" + tx
+ "] - The current transaction will be finalized");
try {
endTransaction(tx);
} catch (Exception e) {
LOGGER.warn("Failed to force current transaction finalization", e);
session.close();
} catch (Exception re) {
LOGGER.warn("Transaction failed to start but the transaction session cannot be closed", re);
LOGGER.debug(() -> "MongoDB transaction [" + tx + "] created and setted as current transaction");
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-core
/**
* Get the Class which corresponds to given type, if available.
* @param type The type
* @return Optional type class
*/
public static Optional<Class<?>> getClassFromType(Type type) {
if (type instanceof Class<?>) {
return Optional.of((Class<?>) type);
}
try {
return Optional.ofNullable(Class.forName(type.getTypeName()));
} catch (Exception e) {
LOGGER.warn("Failed to obtain a Class from Type name [" + type.getTypeName() + "]: " + e.getMessage());
}
return Optional.empty();
}
代码示例来源:origin: com.holon-platform.core/holon-core
/**
* Get a {@link Logger} bound to {@link #NAME}.
* @return Logger
*/
static Logger create() {
return Logger.create(NAME);
}
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-core
/**
* Configure the API listing endpoints, if the configuration is enabled
* @param application The JAX-RS application (not null)
* @return The API endpoint definitions
*/
protected List<ApiEndpointDefinition> configureEndpoints(A application) {
// check disabled
if (configurationProperties.isEnabled()) {
return registerEndpoints(application);
} else {
LOGGER.info("Swagger API endpoints configuration is disabled.");
return Collections.emptyList();
}
}
内容来源于网络,如有侵权,请联系作者删除!