当前位置: 首页>>代码示例>>Java>>正文


Java Log.v方法代码示例

本文整理汇总了Java中com.couchbase.lite.util.Log.v方法的典型用法代码示例。如果您正苦于以下问题:Java Log.v方法的具体用法?Java Log.v怎么用?Java Log.v使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.couchbase.lite.util.Log的用法示例。


在下文中一共展示了Log.v方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: remoteURL

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
private URL remoteURL(HttpServletRequest req) {
    String addr = req.getRemoteAddr();
    Log.v(Log.TAG_LISTENER, "remoteURL() addr=" + addr);
    if (!"127.0.0.1".equals(addr) && !"::1".equals(addr)) {
        // IPv6
        if (addr.indexOf(':') >= 0)
            addr = String.format("[%s]", addr);

        String username = allowedCredentials != null ? allowedCredentials.getLogin() : null;
        String protocol = req.isSecure() ? "https" : "http";
        String spec = null;
        if(username != null && username.length() > 0)
            spec = String.format("%s://%[email protected]%s/", protocol, username, addr);
        else
            spec = String.format("%s://%s/", protocol, addr);
        try {
            return new URL(spec);
        } catch (MalformedURLException e) {
            Log.w(Log.TAG_LISTENER, "failed to create remote URL", e);
            return null;
        }
    }
    return null;
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-listener,代码行数:25,代码来源:LiteServlet.java

示例2: start

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * Starts observing database changes. The .rows property will now update automatically. (You
 * usually don't need to call this yourself, since calling getRows() will start it for you
 */
@InterfaceAudience.Public
public void start() {

    if (runningState.get() == true) {
        Log.v(Log.TAG_QUERY, "%s: start() called, but runningState is already true.  Ignoring.", this);
        return;
    } else {
        Log.d(Log.TAG_QUERY, "%s: start() called", this);
        runningState.set(true);
    }

    if (!observing) {
        observing = true;
        getDatabase().addChangeListener(this);
        Log.v(Log.TAG_QUERY, "%s: start() is calling update()", this);
        update();
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:23,代码来源:LiveQuery.java

示例3: garbageCollectAttachments

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
private boolean garbageCollectAttachments() throws CouchbaseLiteException {
    if (!isOpen()) throw new CouchbaseLiteRuntimeException("Database is closed.");
    storeRef.retain();
    try {
        Log.v(TAG, "Scanning database revisions for attachments...");
        Set<BlobKey> keys = store.findAllAttachmentKeys();
        if (keys == null)
            return false;
        Log.v(TAG, "    ...found %d attachments", keys.size());
        List<BlobKey> keysToKeep = new ArrayList<BlobKey>(keys);
        int deleted = attachments.deleteBlobsExceptWithKeys(keysToKeep);
        Log.v(TAG, "    ... deleted %d obsolete attachment files.", deleted);
        return deleted >= 0;
    } finally {
        storeRef.release();
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:18,代码来源:Database.java

示例4: notifyChangeListenersStateTransition

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
private void notifyChangeListenersStateTransition(
        Transition<ReplicationState, ReplicationTrigger> transition) {
    logTransition(transition);

    ReplicationStateTransition replStateTrans = new ReplicationStateTransition(transition);

    if ((TRANS_RUNNING_TO_IDLE.equals(replStateTrans)
            || TRANS_IDLE_TO_RUNNING.equals(replStateTrans)) && authenticating) {
        Log.i(TAG, "During middle of authentication, not notify Replicator state change");
        return;
    }

    // ignore RUNNING -> STOPPING as both are ACTIVE
    if (TRANS_RUNNING_TO_STOPPING.equals(replStateTrans)) {
        Log.v(TAG, "Both RUNNING and STOPPING are ACTIVE, not notify  Replicator state change");
        return;
    }

    Replication.ChangeEvent changeEvent = new Replication.ChangeEvent(this, replStateTrans);
    notifyChangeListeners(changeEvent);
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:22,代码来源:ReplicationInternal.java

示例5: getDatabase

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * Instantiates a database but doesn't open the file yet.
 * in CBLManager.m
 * - (CBLDatabase*) _databaseNamed: (NSString*)name
 * mustExist: (BOOL)mustExist
 * error: (NSError**)outError
 *
 * @exclude
 */
@InterfaceAudience.Private
public Database getDatabase(String name, boolean mustExist) {
    synchronized (lockDatabases) {
        if (options.isReadOnly())
            mustExist = true;
        Database db = databases.get(name);
        if (db == null) {
            if (!isValidDatabaseName(name))
                throw new IllegalArgumentException("Invalid database name: " + name);
            String path = pathForDatabaseNamed(name);
            if (path == null)
                return null;
            db = new Database(path, name, this, options.isReadOnly());
            if (mustExist && !db.exists()) {
                Log.i(Database.TAG, "mustExist is true and db (%s) does not exist", name);
                return null;
            }
            db.setName(name);
            databases.put(name, db);
        }
        Log.v(Log.TAG_DATABASE, "getDatabase() %s %s", this, db);
        return db;
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:34,代码来源:Manager.java

示例6: optimizeSQLIndexes

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * https://github.com/couchbase/couchbase-lite-ios/issues/615
 */
protected void optimizeSQLIndexes() {
    Log.v(Log.TAG_DATABASE, "calls optimizeSQLIndexes()");
    final long currentSequence = getLastSequence();
    if (currentSequence > 0) {
        final long lastOptimized = getLastOptimized();
        if (lastOptimized <= currentSequence / 10) {
            runInTransaction(new TransactionalTask() {
                @Override
                public boolean run() {
                    Log.i(Log.TAG_DATABASE, "%s: Optimizing SQL indexes (curSeq=%d, last run at %d)",
                            this, currentSequence, lastOptimized);
                    storageEngine.execSQL("ANALYZE");
                    storageEngine.execSQL("ANALYZE sqlite_master");
                    setInfo("last_optimized", String.valueOf(currentSequence));
                    return true;
                }
            });
        }
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:24,代码来源:SQLiteStore.java

示例7: scheduleDocumentExpiration

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
private void scheduleDocumentExpiration(long minimumDelay) {
    if (!isOpen()) throw new CouchbaseLiteRuntimeException("Database is closed.");
    storeRef.retain();
    try {
        long nextExpiration = store.nextDocumentExpiry();
        if (nextExpiration > 0) {
            long delay = Math.max((nextExpiration - System.currentTimeMillis()) / 1000 + 1, minimumDelay);
            Log.v(TAG, "Scheduling next doc expiration in %d sec", delay);
            cancelPurgeTimer();
            purgeTimer = new Timer();
            purgeTimer.schedule(new TimerTask() {
                @Override
                public void run() {
                    if (isOpen())
                        purgeExpiredDocuments();
                }
            }, delay * 1000);
        } else
            Log.v(TAG, "No pending doc expirations");
    } finally {
        storeRef.release();
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:24,代码来源:Database.java

示例8: purgeSequences

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
private boolean purgeSequences(Set<Long> seqsToPurge) {
    if (seqsToPurge.size() == 0)
        return true;

    String seqsString = TextUtils.join(",", seqsToPurge);
    Log.v(TAG, "    purging %d sequences: %s", seqsToPurge.size(), seqsString);
    String sql = String.format(Locale.ENGLISH, "DELETE FROM revs WHERE sequence in (%s)", seqsString);
    try {
        storageEngine.execSQL(sql);
    } catch (SQLException e) {
        Log.e(TAG, "Error deleting revisions via: " + sql, e);
        return false;
    }
    return true;
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:16,代码来源:SQLiteStore.java

示例9: unschedule

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * Unschedule the scheduled batch processing.
 */
private void unschedule() {
    synchronized (mutex) {
        if (pendingFuture != null && !pendingFuture.isDone() && !pendingFuture.isCancelled()) {
            Log.v(Log.TAG_BATCHER, "%s: cancelling the pending future ...", this);
            pendingFuture.cancel(false);
        }
        scheduled = false;
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:13,代码来源:Batcher.java

示例10: addToCompletedChangesCount

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
@InterfaceAudience.Private
protected void addToCompletedChangesCount(int delta) {
    int previousVal = getCompletedChangesCount().getAndAdd(delta);
    Log.v(Log.TAG_SYNC, "%s: Incrementing completedChangesCount count from %s by adding %d -> %d",
            this, previousVal, delta, completedChangesCount.get());
    Replication.ChangeEvent changeEvent = new Replication.ChangeEvent(this);
    notifyChangeListeners(changeEvent);
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:9,代码来源:ReplicationInternal.java

示例11: addToChangesCount

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
@InterfaceAudience.Private
protected void addToChangesCount(int delta) {
    int previousVal = getChangesCount().getAndAdd(delta);
    if (getChangesCount().get() < 0) {
        Log.w(Log.TAG_SYNC, "Changes count is negative, this could indicate an error");
    }
    Log.v(Log.TAG_SYNC, "%s: Incrementing changesCount count from %s by adding %d -> %d",
            this, previousVal, delta, changesCount.get());
    Replication.ChangeEvent changeEvent = new Replication.ChangeEvent(this);
    notifyChangeListeners(changeEvent);
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:12,代码来源:ReplicationInternal.java

示例12: finishedPart

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * This method is called when a part is complete.
 */
@Override
public void finishedPart() {
    if (_docReader == null)
        throw new IllegalStateException("_docReader is not defined");
    _docReader.finish();
    _onDocument.onDocument(_docReader.getDocumentProperties(), _docReader.getDocumentSize());
    _docReader = null;
    Log.v(TAG, "%s: Finished document", this);
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:13,代码来源:RemoteBulkDownloaderRequest.java

示例13: retryIfReady

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * in CBL_Replicator.m
 * - (void) retryIfReady
 */
protected void retryIfReady() {
    Log.v(Log.TAG_SYNC, "[retryIfReady()] stateMachine => " + stateMachine.getState().toString());
    // check if state is still IDLE (ONLINE), then retry now.
    if (stateMachine.getState().equals(ReplicationState.IDLE)) {
        Log.v(Log.TAG_SYNC, "%s RETRYING, to transfer missed revisions...", this);
        cancelRetryFuture();
        retry();
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:14,代码来源:ReplicationInternal.java

示例14: scheduleRetryFuture

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
/**
 * helper function to schedule retry future. no in iOS code.
 */
private void scheduleRetryFuture() {
    Log.v(Log.TAG_SYNC, "%s: Failed to xfer; will retry in %d sec", this, RETRY_DELAY_SECONDS);
    synchronized (executor) {
        if (!executor.isShutdown()) {
            this.retryFuture = executor.schedule(new Runnable() {
                public void run() {
                    retryIfReady();
                }
            }, RETRY_DELAY_SECONDS, TimeUnit.SECONDS);
        }
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:16,代码来源:ReplicationInternal.java

示例15: waitIfPaused

import com.couchbase.lite.util.Log; //导入方法依赖的package包/类
private void waitIfPaused() {
    synchronized (pausedObj) {
        while (paused && isRunning()) {
            Log.v(TAG, "Waiting: " + paused);
            try {
                // every 1 sec, wake by myself to check if still needs to pause
                pausedObj.wait(TIMEOUT_FOR_PAUSE);
            } catch (InterruptedException e) {
            }
        }
    }
}
 
开发者ID:couchbase,项目名称:couchbase-lite-java-core,代码行数:13,代码来源:PusherInternal.java


注:本文中的com.couchbase.lite.util.Log.v方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。