本文整理了Java中com.vmware.xenon.common.Utils.log()
方法的一些代码示例,展示了Utils.log()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.log()
方法的具体详情如下:
包路径:com.vmware.xenon.common.Utils
类名称:Utils
方法名:log
暂无
代码示例来源:origin: vmware/xenon
private void log(Level level, String fmt, Object... args) {
Utils.log(Http2NegotiationHandler.class, Http2NegotiationHandler.class.getSimpleName(),
level, fmt, args);
}
}
代码示例来源:origin: vmware/admiral
public void registerCertificate(SslTrustCertificateState sslTrustCert) {
String alias = sslTrustCert.getAlias();
try {
this.putDelegate(alias, sslTrustCert.certificate);
Utils.log(getClass(), "Self Signed Trust Store", Level.FINE,
"Certificate with alias %s updated", alias);
} catch (Throwable e) {
Utils.logWarning(
"Exception during certificate reload with alias: %s. Error: %s",
alias, Utils.toString(e));
}
}
代码示例来源:origin: vmware/admiral
private static void logError(String message, Object... values) {
Utils.log(ClosureUtils.class, ClosureUtils.class.getSimpleName(), Level.SEVERE, message,
values);
}
}
代码示例来源:origin: vmware/admiral
private void loadCertificate(SslTrustCertificateState sslTrustCert) {
try {
self.putDelegate(sslTrustCert.getAlias(), sslTrustCert.certificate);
Utils.log(getClass(), "Self Signed Trust Store", Level.FINE,
"Certificate with alias %s updated", sslTrustCert.getAlias());
} catch (Throwable e) {
Utils.logWarning(
"Exception during certificate reload with alias: %s. Error: %s",
sslTrustCert.getAlias(), Utils.toString(e));
}
}
代码示例来源:origin: com.vmware.xenon/slf4j-xenon
private void doLog(Level lvl, String msg) {
if (this.logger.isLoggable(lvl)) {
Utils.log(this.logger, 4, name, lvl, "%s", msg);
}
}
代码示例来源:origin: vmware/xenon
public static void log(Class<?> type, String classOrUri, Level level,
Supplier<String> messageSupplier) {
Logger lg = Logger.getLogger(type.getName());
log(lg, 3, classOrUri, level, messageSupplier);
}
代码示例来源:origin: vmware/xenon
public static void log(Class<?> type, String classOrUri, Level level, String fmt,
Object... args) {
Logger lg = Logger.getLogger(type.getName());
log(lg, 3, classOrUri, level, () -> String.format(fmt, args));
}
代码示例来源:origin: vmware/admiral
private static void print(String key, String value) {
if (propertiesToPrint.containsKey(key)) {
Utils.log(ConfigurationService.class, ConfigurationService.class.getSimpleName(),
Level.INFO, "%s : %s", propertiesToPrint.get(key), value);
}
}
代码示例来源:origin: vmware/xenon
/**
* Build new URI based on a canonical URL, i.e., "http://example.com/example")
*/
public static URI buildUri(String uri) {
try {
return new URI(uri);
} catch (Exception e) {
Utils.log(Utils.class, Utils.class.getSimpleName(), Level.SEVERE,
"Failure building uri %s: %s", uri, Utils.toString(e));
}
return null;
}
代码示例来源:origin: vmware/xenon
protected void log(Level level, Integer nestingLevel, String fmt, Object... args) {
if (this.logPrefix == null) {
this.logPrefix = getPublicUri().toString();
}
Utils.log(this.logger, nestingLevel, this.logPrefix, level, () -> String.format(fmt, args));
}
代码示例来源:origin: vmware/xenon
protected void doLogging(Level level, Supplier<String> messageSupplier) {
Logger lg = Logger.getLogger(this.getClass().getName());
if (!lg.isLoggable(level)) {
return;
}
URI uri;
String classOrUri = this.host != null && this.selfLink != null && (uri = getUri()) != null ?
uri.toString() :
this.getClass().getSimpleName();
Utils.log(lg, 3, classOrUri, level, messageSupplier);
}
代码示例来源:origin: vmware/xenon
protected void log(Level level, Integer nestingLevel, Supplier<String> messageSupplier) {
if (this.logPrefix == null) {
this.logPrefix = getPublicUri().toString();
}
Utils.log(this.logger, nestingLevel, this.logPrefix, level, messageSupplier);
}
代码示例来源:origin: vmware/admiral
private void deleteCertificate(String alias) {
self.delegatingTrustManager.removeDelegate(alias);
Utils.log(getClass(), "Self Signed Trust Store", Level.FINE,
"Certificate with alias %s removed", alias);
}
}
代码示例来源:origin: vmware/admiral
private void deleteCertificate(String alias) {
this.delegatingTrustManager.removeDelegate(alias);
Utils.log(getClass(), "Self Signed Trust Store", Level.FINE,
"Certificate with alias %s removed", alias);
}
代码示例来源:origin: vmware/xenon
protected void doLogging(Level level, Supplier<String> messageSupplier) {
Logger lg = Logger.getLogger(this.getClass().getName());
if (!lg.isLoggable(level)) {
return;
}
URI uri;
String classOrUri = this.context.host != null && this.context.selfLink != null
&& (uri = getUri()) != null ? uri.toString() : this.getClass().getSimpleName();
Utils.log(lg, 3, classOrUri, level, messageSupplier);
}
代码示例来源:origin: vmware/xenon
public static URI buildPublicUri(ServiceHost host, String path, String query) {
URI baseUri = host.getPublicUri();
try {
return new URI(baseUri.getScheme(), baseUri.getUserInfo(), baseUri.getHost(),
baseUri.getPort(), path, query, null);
} catch (Exception e) {
Utils.log(Utils.class, Utils.class.getSimpleName(), Level.SEVERE,
"Failure building uri %s, %s, %s: %s", baseUri, path, query,
Utils.toString(e));
}
return null;
}
代码示例来源:origin: com.vmware.xenon/xenon-slf4j
private void doLog(Level lvl, FormattingTuple tuple) {
if (tuple.getThrowable() == null) {
Utils.log(this.logger, 5, this.name, lvl, "%s", tuple.getMessage());
} else {
Utils.log(this.logger, 5, this.name, lvl, "%s: %s", tuple.getMessage(), Utils.toString(tuple.getThrowable()));
}
}
代码示例来源:origin: vmware/admiral
private static ResourceState extractState(Operation o) {
String path = o.getUri().getPath();
ComponentMeta meta = CompositeComponentRegistry.metaByStateLink(path);
if (meta.stateClass == null) {
Utils.log(CompositeComponentInterceptor.class,
CompositeComponentInterceptor.class.getSimpleName(),
Level.WARNING, "Cannot find meta for path = %s", path);
}
ResourceState state = o.getBody(meta.stateClass);
return state;
}
}
代码示例来源:origin: vmware/xenon
private void log(Operation op, OperationProcessingContext context, String msg, Level logLevel) {
String hostId = context.host != null ? context.host.getId() : "";
String path = op.getUri() != null ? op.getUri().getPath() : "";
Filter filter = this.filters.get(context.currentFilterPosition);
String filterName = filter != null ? filter.getClass().getSimpleName() : "";
String logMsg = String.format("(host: %s, op %d %s %s) filter %s: %s",
hostId, op.getId(), op.getAction(), path, filterName, msg);
Level level = logLevel != null ? logLevel : Level.INFO;
Utils.log(getClass(), op.getUri().getPath(), level, logMsg);
}
}
代码示例来源:origin: vmware/xenon
@Override
public FilterReturnCode processRequest(Operation op, OperationProcessingContext context) {
Utils.log(context.getService().getClass(), context.getService().getClass().getName(),
Level.INFO, "Operation: %s", op);
return FilterReturnCode.CONTINUE_PROCESSING;
}
}
内容来源于网络,如有侵权,请联系作者删除!