本文整理汇总了Java中com.hazelcast.logging.ILogger.severe方法的典型用法代码示例。如果您正苦于以下问题:Java ILogger.severe方法的具体用法?Java ILogger.severe怎么用?Java ILogger.severe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.logging.ILogger
的用法示例。
在下文中一共展示了ILogger.severe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withTryCatch
import com.hazelcast.logging.ILogger; //导入方法依赖的package包/类
/**
* Utility to make sure exceptions inside
* {@link java.util.concurrent.CompletionStage#whenComplete(BiConsumer)} are not swallowed.
* Exceptions will be caught and logged using the supplied logger and message.
*/
@Nonnull
public static <T> BiConsumer<T, ? super Throwable> withTryCatch(
@Nonnull ILogger logger, @Nonnull String message, @Nonnull BiConsumer<T, ? super Throwable> consumer
) {
return (r, t) -> {
try {
consumer.accept(r, t);
} catch (Throwable e) {
logger.severe(message, e);
}
};
}
示例2: init
import com.hazelcast.logging.ILogger; //导入方法依赖的package包/类
@Override
public void init(List<URI> etcdUris,
String etcdUsername,
String etcdPassword,
String etcdServiceName,
DiscoveryNode localDiscoveryNode,
Map<String, Object> registratorConfig,
ILogger logger) throws Exception {
this.logger = logger;
this.etcdUsername = etcdUsername;
this.etcdPassword = etcdPassword;
this.etcdServiceName = etcdServiceName;
this.etcdUris = etcdUris;
try {
/**
* Determine my local address
*/
this.myLocalAddress = determineMyLocalAddress(localDiscoveryNode, registratorConfig);
logger.info("Determined local DiscoveryNode address to use: " + myLocalAddress);
} catch(Exception e) {
String msg = "Unexpected error in configuring LocalDiscoveryNodeRegistration: " + e.getMessage();
logger.severe(msg,e);
throw new Exception(msg,e);
}
}
示例3: init
import com.hazelcast.logging.ILogger; //导入方法依赖的package包/类
@Override
public void init(String consulHost,
Integer consulPort,
String consulServiceName,
String[] consulTags,
String consulAclToken,
boolean consulSslEnabled,
String consulSslServerCertFilePath,
String consulSslServerCertBase64,
boolean consulServerHostnameVerify,
DiscoveryNode localDiscoveryNode,
Map<String, Object> registratorConfig,
ILogger logger) throws Exception {
this.logger = logger;
this.tags = consulTags;
this.consulHost = consulHost;
this.consulPort = consulPort;
this.consulServiceName = consulServiceName;
this.consulAclToken = consulAclToken;
this.registratorConfig = registratorConfig;
try {
/**
* Determine my local address
*/
this.myLocalAddress = determineMyLocalAddress(localDiscoveryNode, registratorConfig);
logger.info("Determined local DiscoveryNode address to use: " + myLocalAddress);
//Build our consul client to use. We pass in optional TLS information
ConsulBuilder builder = ConsulClientBuilder.class.newInstance();
Consul consul = builder.buildConsul(consulHost,
consulPort,
consulSslEnabled,
consulSslServerCertFilePath,
consulSslServerCertBase64,
consulServerHostnameVerify,
consulAclToken);
// build my Consul agent client that we will register with
this.consulAgentClient = consul.agentClient();
} catch(Exception e) {
String msg = "Unexpected error in configuring LocalDiscoveryNodeRegistration: " + e.getMessage();
logger.severe(msg,e);
throw new Exception(msg,e);
}
}