GVKun编程网logo

com.mysql.jdbc.log.LogFactory的实例源码

2

在这篇文章中,我们将带领您了解com.mysql.jdbc.log.LogFactory的实例源码的全貌,同时,我们还将为您介绍有关AndroidLog.v()、Log.d()、Log.i()、Log

在这篇文章中,我们将带领您了解com.mysql.jdbc.log.LogFactory的实例源码的全貌,同时,我们还将为您介绍有关Android Log.v()、Log.d()、Log.i()、Log.w()、Log.e() - 什么时候使用它们?、Android Log.v(),Log.d(),Log.i(),Log.w(),Log.e() - 何时使用每一个?、android.util.Log常用的方法(Log.v,Log.d,Log.i,Log.w,Log.e)、Android中级教程之----Log图文详解(Log.v,Log.d,Log.i,Log.w,L的知识,以帮助您更好地理解这个主题。

本文目录一览:

com.mysql.jdbc.log.LogFactory的实例源码

com.mysql.jdbc.log.LogFactory的实例源码

项目:locaviewer    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),LOGGER_INSTANCE_NAME,getExceptionInterceptor());

    if (getProfilesql() || getUseUsageAdvisor()) {
        this.eventSink = ProfilerEventHandlerFactory.getInstance(getLoadBalanceSafeProxy());
    }

    if (getCachePreparedStatements()) {
        createPreparedStatementCaches();
    }

    if (getNoDatetimeStringSync() && getUseTimezone()) {
        throw sqlError.createsqlException("Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time",sqlError.sql_STATE_INVALID_CONNECTION_ATTRIBUTE,getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }
}
项目:the-vigilantes    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,handle and remove Fabric-specific properties.  once fabricShardKey et al are ConnectionProperty instances this will be unnecessary
    this.fabricShardKey = props.getProperty(FabricMysqLDriver.FABRIC_SHARD_KEY_PROPERTY_KEY);
    this.fabricShardTable = props.getProperty(FabricMysqLDriver.FABRIC_SHARD_TABLE_PROPERTY_KEY);
    this.fabricServerGroup = props.getProperty(FabricMysqLDriver.FABRIC_SERVER_GROUP_PROPERTY_KEY);
    this.fabricProtocol = props.getProperty(FabricMysqLDriver.FABRIC_PROTOCOL_PROPERTY_KEY);
    this.fabricUsername = props.getProperty(FabricMysqLDriver.FABRIC_USERNAME_PROPERTY_KEY);
    this.fabricPassword = props.getProperty(FabricMysqLDriver.FABRIC_PASSWORD_PROPERTY_KEY);
    this.reportErrors = Boolean.valueOf(props.getProperty(FabricMysqLDriver.FABRIC_REPORT_ERRORS_PROPERTY_KEY));
    props.remove(FabricMysqLDriver.FABRIC_SHARD_KEY_PROPERTY_KEY);
    props.remove(FabricMysqLDriver.FABRIC_SHARD_TABLE_PROPERTY_KEY);
    props.remove(FabricMysqLDriver.FABRIC_SERVER_GROUP_PROPERTY_KEY);
    props.remove(FabricMysqLDriver.FABRIC_PROTOCOL_PROPERTY_KEY);
    props.remove(FabricMysqLDriver.FABRIC_USERNAME_PROPERTY_KEY);
    props.remove(FabricMysqLDriver.FABRIC_PASSWORD_PROPERTY_KEY);
    props.remove(FabricMysqLDriver.FABRIC_REPORT_ERRORS_PROPERTY_KEY);

    this.host = props.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY);
    this.port = props.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY);
    this.username = props.getProperty(NonRegisteringDriver.USER_PROPERTY_KEY);
    this.password = props.getProperty(NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
    this.database = props.getProperty(NonRegisteringDriver.dbnAME_PROPERTY_KEY);
    if (this.username == null) {
        this.username = "";
    }
    if (this.password == null) {
        this.password = "";
    }

    // add our interceptor to pass exceptions back to the `interceptException' method
    String exceptionInterceptors = props.getProperty("exceptionInterceptors");
    if (exceptionInterceptors == null || "null".equals("exceptionInterceptors")) {
        exceptionInterceptors = "";
    } else {
        exceptionInterceptors += ",";
    }
    exceptionInterceptors += "com.MysqL.fabric.jdbc.ErrorReportingExceptionInterceptor";
    props.setProperty("exceptionInterceptors",exceptionInterceptors);

    initializeProperties(props);

    // validation check of properties
    if (this.fabricServerGroup != null && this.fabricShardTable != null) {
        throw sqlError.createsqlException("Server group and shard table are mutually exclusive. Only one may be provided.",sqlError.sql_STATE_CONNECTION_REJECTED,null,getExceptionInterceptor(),this);
    }

    try {
        String url = this.fabricProtocol + "://" + this.host + ":" + this.port;
        this.fabricConnection = new FabricConnection(url,this.fabricUsername,this.fabricPassword);
    } catch (FabricCommunicationException ex) {
        throw sqlError.createsqlException("Unable to establish connection to the Fabric server",ex,this);
    }

    // initialize log before any further calls that might actually use it
    this.log = LogFactory.getLogger(getLogger(),"FabricMysqLConnectionProxy",null);

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);
}
项目:the-vigilantes    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());

    if (getProfilesql() || getUseUsageAdvisor()) {
        this.eventSink = ProfilerEventHandlerFactory.getInstance(getMultiHostSafeProxy());
    }

    if (getCachePreparedStatements()) {
        createPreparedStatementCaches();
    }

    if (getNoDatetimeStringSync() && getUseTimezone()) {
        throw sqlError.createsqlException("Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time",getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:OpenVertretung    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,null);

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);
}
项目:OpenVertretung    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:lams    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,this);
    }

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);

    this.log = LogFactory.getLogger(getLogger(),null);
}
项目:lams    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:ProyectoPacientes    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,null);

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);
}
项目:ProyectoPacientes    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:BibliotecaPS    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,null);

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);
}
项目:BibliotecaPS    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache<CompoundCacheKey,CallableStatement.CallableStatementParamInfo>(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache<String,CachedResultSetMetaData>(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:Geometry-wars    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,null);

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);
}
项目:Geometry-wars    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:TPKB    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:cloudera-cli-scripts    文件:FabricMysqLConnectionProxy.java   
public FabricMysqLConnectionProxy(Properties props) throws sqlException {
    // first,this);
    }

    setShardTable(this.fabricShardTable);
    setShardKey(this.fabricShardKey);

    setServerGroupName(this.fabricServerGroup);

    log = LogFactory.getLogger(getLogger(),null);
}
项目:cloudera-cli-scripts    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:fil_project_mgmt_app_v2    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 *            DOCUMENT ME!
 * @throws sqlException
 *             DOCUMENT ME!
 */
private void initializeDriverProperties(Properties info)
        throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());

    if (getProfilesql() || getUseUsageAdvisor()) {
        this.eventSink = ProfilerEventHandlerFactory.getInstance(getLoadBalanceSafeProxy());
    }

    if (getCachePreparedStatements()) {
        createPreparedStatementCaches();        
    }

    if (getNoDatetimeStringSync() && getUseTimezone()) {
        throw sqlError.createsqlException(
                "Can't enable noDatetimeStringSync and useTimezone configuration "
                        + "properties at the same time",getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(
                getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(
                getMetadataCacheSize());
    }
}
项目:SMPT42    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:ForYou    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 *            DOCUMENT ME!
 * @throws sqlException
 *             DOCUMENT ME!
 */
private void initializeDriverProperties(Properties info)
        throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
        this.exceptionInterceptor.init(this,info);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(
                getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(
                getMetadataCacheSize());
    }
}
项目:group-five    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 * @throws sqlException
 */
private void initializeDriverProperties(Properties info) throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    if (getSocksProxyHost() != null) {
        setSocketFactoryClassName("com.MysqL.jdbc.socksProxySocketFactory");
    }
}
项目:manydesigns.cn    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 *            DOCUMENT ME!
 * @throws sqlException
 *             DOCUMENT ME!
 */
private void initializeDriverProperties(Properties info)
        throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
        this.exceptionInterceptor.init(this,getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(
                getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(
                getMetadataCacheSize());
    }
}
项目:Gladiatus    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 *            DOCUMENT ME!
 * @throws sqlException
 *             DOCUMENT ME!
 */
private void initializeDriverProperties(Properties info)
        throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
    }

    this.usePlatformCharsetConverters = getUseJvmCharsetConverters();

    this.log = LogFactory.getLogger(getLogger(),getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(
                getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(
                getMetadataCacheSize());
    }
}
项目:Jspad    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 *            DOCUMENT ME!
 * @throws sqlException
 *             DOCUMENT ME!
 */
private void initializeDriverProperties(Properties info)
        throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
        this.exceptionInterceptor.init(this,getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(
                getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(
                getMetadataCacheSize());
    }
}
项目:Trails    文件:ConnectionImpl.java   
/**
 * Initializes driver properties that come from URL or properties passed to
 * the driver manager.
 * 
 * @param info
 *            DOCUMENT ME!
 * @throws sqlException
 *             DOCUMENT ME!
 */
private void initializeDriverProperties(Properties info)
        throws sqlException {
    initializeProperties(info);

    String exceptionInterceptorClasses = getExceptionInterceptors();

    if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
        this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
        this.exceptionInterceptor.init(this,getExceptionInterceptor());
    }

    if (getCacheCallableStatements()) {
        this.parsedCallableStatementCache = new LRUCache(
                getCallableStatementCacheSize());
    }

    if (getAllowMultiQueries()) {
        setCacheResultSetMetadata(false); // we don't handle this yet
    }

    if (getCacheResultSetMetadata()) {
        this.resultSetMetadataCache = new LRUCache(
                getMetadataCacheSize());
    }
}

Android Log.v()、Log.d()、Log.i()、Log.w()、Log.e() - 什么时候使用它们?

Android Log.v()、Log.d()、Log.i()、Log.w()、Log.e() - 什么时候使用它们?

不同的LogCat方法是:

Log.v(); // VerboseLog.d(); // DebugLog.i(); // InfoLog.w(); // WarningLog.e(); // Error

使用每种类型的 Logging 的合适情况是什么?我知道这也许只是一点点语义,也许并不重要,但对于LogCat在 Android Studio 和
Eclipse 中进行过滤,很高兴知道我在适当的时间使用了正确的方法。

答案1

小编典典

让我们以相反的顺序进行:

  • Log.e :这是为了当坏事发生时。在 catch 语句中等位置使用此标记。您 知道 发生了 错误 ,因此您正在记录错误。

  • Log.w :当您怀疑发生了一些可疑的事情时使用它。你可能没有完全进入错误模式,但也许你从一些意想不到的行为中恢复过来。基本上,使用它来记录您不希望发生但不一定是错误的事情。有点像“嘿,这件事发生了,很 奇怪 ,我们应该调查一下。”

  • Log.i :使用它来将有用 的信息 发布到日志中。例如:您已成功连接到服务器。基本上用它来报告成功。

  • Log.d :将其用于 调试 目的。如果您想打印出一堆消息以便记录程序的确切流程,请使用它。如果要保留变量值的日志,请使用它。

  • Log.v :当你想对你的日志完全疯狂时使用它。如果出于某种原因您决定在应用程序的特定部分中记录每一件小事,请使用 Log.v 标记。

作为奖励…

  • Log.wtf :当事情绝对,可怕,神圣的废话错误时使用它。你知道那些你在捕捉你 永远不 应该得到的错误的 catch 块......是的,如果你想记录它们,请使用 Log.wtf

Android Log.v(),Log.d(),Log.i(),Log.w(),Log.e() - 何时使用每一个?

Android Log.v(),Log.d(),Log.i(),Log.w(),Log.e() - 何时使用每一个?

不同的LogCat方法是:

Log.v(); // Verbose
Log.d(); // Debug
Log.i(); // Info
Log.w(); // Warning
Log.e(); // Error

使用每种类型的日志记录的适当情况是什么? 我知道也许这只是一些语义,也许它并不重要,但对于Android Studio和Eclipse中的LogCat过滤,我很高兴知道我在适当的时候使用了正确的方法。


#1楼

源代码提供了一些基本指导:

详细程度的顺序,从最小到最多,是ERROR,WARN,INFO,DEBUG,VERBOSE。 除了在开发期间,不应该将详细编译到应用程序中。 调试日志在运行时编译但被剥离。 始终保留错误,警告和信息日志。

更多细节,Kurtis的答案已经过去了。 我想补充一点:不要在INFO或以上( WARN / ERROR )记录任何个人身份信息或私人信息。 否则,错误报告或包含日志记录的任何其他内容可能会受到污染。


#2楼

Android Studio网站最近(我认为)提供了一些建议,从Kurtis的回答中可能有用的不同日志级别期望什么样的消息:

  • 详细 - 显示所有日志消息(默认)。
  • 调试 - 显示仅在开发期间有用的调试日志消息,以及此列表中较低的消息级别。
  • 信息 - 显示常规使用的预期日志消息,以及此列表中较低的消息级别。
  • 警告 - 显示尚未出现错误的可能问题,以及此列表中较低的消息级别。
  • 错误 - 显示导致错误的问题,以及此列表中较低的消息级别。
  • 断言 - 显示开发人员期望永远不会发生的问题。

#3楼

你可以使用LOG如:

Log.e(String, String) (error)
Log.w(String, String) (warning)
Log.i(String, String) (information)
Log.d(String, String) (debug)
Log.v(String, String) (verbose)

示例代码:

private static final String TAG = "MyActivity";
...
Log.i(TAG, "MyClass.getView() — get item number " + position);

#4楼

虽然这个问题已经回答了,但我觉得答案中有缺少的例子。

因此,我将把我在博客文章“Android Log Levels”中写的内容带到这里

详细

是最低级别的日志记录。 如果你想坚持记录,那么你就可以使用这个级别了。 我从来不知道何时使用Verbose以及何时使用Debug。 差别对我来说非常武断。 一旦我指出Android¹的源代码,我终于理解了“除了在开发过程中,不应该将Verbose编译成应用程序。”现在我很清楚,无论何时开发并想要添加可删除的日志来帮助你开发有用的是详细级别,这有助于您在投入生产之前删除所有这些日志。

调试

用于调试目的。 这是生产中应该达到的最低水平。 这里的信息是在开发过程中提供帮助。 大多数情况下,您将禁用此生产日志,以便发送较少的信息,并且只有在出现问题时才启用此日志。 我喜欢登录调试应用程序从服务器发送/接收的所有信息(注意不要记录密码!!!)。 这对于了解错误是在服务器还是应用程序中非常有帮助。 我还会记录进入和退出重要功能的日志。

信息

有关突出显示应用程序进度的信息性消息。 例如,当应用程序的初始化完成时。 当用户在活动和片段之间移动时添加信息。 记录每个API调用,但只记录URL,状态和响应时间等信息。

警告

当存在潜在的有害情况时。

这个日志在我的经历中是一个棘手的水平。 你什么时候有潜在的有害情况? 一般情况下或它是好的或它是一个错误。 我个人不太喜欢这个级别。 我使用它的例子通常是多次发生的事情。 例如,用户的密码错误超过3次。 这可能是因为他错误地输入了3次密码,也可能是因为我们的系统中没有接受某个字符存在问题。 网络连接问题也是如此。

错误

错误事件。 错误后应用程序仍可继续运行。 这可能是例如当我得到一个空指针,我不应该得到一个。 解析服务器的响应时出错。 从服务器收到错误。

WTF(多么可怕的失败)

致命是导致应用程序退出的严重错误事件。 在Android中,致命的是实际上的错误级别,不同之处在于它还添加了fullstack。


#5楼

我们按相反顺序进行:

  • Log.e :这是为了发生坏事。 在catch语句中使用此标记。 您知道发生了错误 ,因此您正在记录错误。

  • Log.w :当你怀疑阴影正在发生时使用它。 您可能无法在错误模式下完全完整,但也许您从某些意外行为中恢复过来。 基本上,使用它来记录您不希望发生的事情,但不一定是错误。 有点像“嘿,这发生了,而且很奇怪 ,我们应该调查它。”

  • Log.i :使用此命令将有用信息发布到日志中。 例如:您已成功连接到服务器。 基本上用它来报告成功。

  • Log.d :用于调试目的。 如果要打印出大量消息,以便记录程序的确切流程,请使用此方法。 如果要保留变量值的日志,请使用此选项。

  • Log.v :当您想要完全记录日志时使用此选项。 如果由于某种原因您决定在应用程序的特定部分记录每个小东西,请使用Log.v标记。

作为奖励......

  • Log.wtf :当东西绝对可怕时,使用这个,可怕的,神圣的错误。 你知道那些捕获块,你捕获的错误,你永远不会得到...是的,如果你想记录它们使用Log.wtf

android.util.Log常用的方法(Log.v,Log.d,Log.i,Log.w,Log.e)

android.util.Log常用的方法(Log.v,Log.d,Log.i,Log.w,Log.e)

android.util.Log常用的方法有以下5个:Log.v() Log.d() Log.i() Log.w() 以及 Log.e() 。根据首字母对应VERBOSE,DEBUG,INFO, WARN,ERROR。

1、Log.v 的调试颜色为黑色的,任何消息都会输出,这里的v代表verbose啰嗦的意思,平时使用就是Log.v("","");

2、Log.d的输出颜色是蓝色的,仅输出debug调试的意思,但他会输出上层的信息,过滤起来可以通过DDMS的Logcat标签来选择;

3、Log.i的输出为绿色,一般提示性的消息information,它不会输出Log.v和Log.d的信息,但会显示i、w和e的信息;

4、Log.w的意思为橙色,可以看作为warning警告,一般需要我们注意优化Android代码,同时选择它后还会输出Log.e的信息;

5、Log.e为红色,可以想到error错误,这里仅显示红色的错误信息,这些错误就需要我们认真的分析,查看栈的信息了;

android开发中, Log.e(TAG )与System打印有什么区别?
用log的话你可以自定tag,还可以用v、d、i、w、e等,它们打印的颜色是不同的,如v是黑色,w是黄色,e是红色……在你输出调试信息、错误信息等的时候可以更容易从众多信息中找出

Android中级教程之----Log图文详解(Log.v,Log.d,Log.i,Log.w,L

Android中级教程之----Log图文详解(Log.v,Log.d,Log.i,Log.w,L

android.util.Log常用的方法有以下5个:Log.v() Log.d() Log.i() Log.w() 以及 Log.e() 。根据首字母对应VERBOSEDEBUG,INFOWARNERROR

1、Log.v 的调试颜色为黑色的,任何消息都会输出,这里的v代表verbose啰嗦的意思,平时使用就是Log.v("","");

2、Log.d的输出颜色是蓝色的,仅输出debug调试的意思,但他会输出上层的信息,过滤起来可以通过DDMS的Logcat标签来选择.

3、Log.i的输出为绿色,一般提示性的消息information,它不会输出Log.v和Log.d的信息,但会显示i、w和e的信息

4、Log.w的意思为橙色,可以看作为warning警告,一般需要我们注意优化Android代码,同时选择它后还会输出Log.e的信息。

5、Log.e为红色,可以想到error错误,这里仅显示红色的错误信息,这些错误就需要我们认真的分析,查看栈的信息了。

其语法是Log.i(TAG,"信息");

关于com.mysql.jdbc.log.LogFactory的实例源码的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于Android Log.v()、Log.d()、Log.i()、Log.w()、Log.e() - 什么时候使用它们?、Android Log.v(),Log.d(),Log.i(),Log.w(),Log.e() - 何时使用每一个?、android.util.Log常用的方法(Log.v,Log.d,Log.i,Log.w,Log.e)、Android中级教程之----Log图文详解(Log.v,Log.d,Log.i,Log.w,L的相关知识,请在本站寻找。

本文标签: