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


Java Logger.d方法代码示例

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


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

示例1: deserializeBody

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void deserializeBody(InputStream stream, TLContext context) throws IOException {
    if (this.destClass == null) {
        throw new IOException("DestClass not set");
    }
    int count = readInt(stream);
    for (int i = 0; i < count; i++) {
        Logger.d("TLVECTOR", "reading: " + i + " from " + count + " (" + this.items.size() + ")" + " --> " + this.destClass);
        if (this.destClass == Integer.class) {
            this.items.add((T) (Integer) readInt(stream));
        } else if (this.destClass == Long.class) {
            this.items.add((T) (Long) readLong(stream));
        } else if (this.destClass == String.class) {
            this.items.add((T) readTLString(stream));
        } else {
            this.items.add((T) context.deserializeMessage(stream));
        }
        Logger.d("TLVECTOR", "Extracted " + this.items.get(i).toString());
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:21,代码来源:TLVector.java

示例2: run

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void run() {
    setPriority(Thread.MIN_PRIORITY);
    while (!MTProto.this.isClosed) {
        if (Logger.LOG_THREADS) {
            Logger.d(MTProto.this.TAG, "Response Iteration");
        }
        synchronized (MTProto.this.inQueue) {
            if (MTProto.this.inQueue.isEmpty()) {
                try {
                    MTProto.this.inQueue.wait();
                } catch (InterruptedException e) {
                    return;
                }
            }
            if (MTProto.this.inQueue.isEmpty()) {
                continue;
            }
        }
        MTMessage message = MTProto.this.inQueue.poll();
        onMTMessage(message);
        BytesCache.getInstance().put(message.getContent());
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:25,代码来源:MTProto.java

示例3: onChannelBroken

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void onChannelBroken(TcpContext context) {
    if (MTProto.this.isClosed) {
        return;
    }
    int contextId = context.getContextId();
    Logger.d(MTProto.this.TAG, "onChannelBroken (#" + contextId + ")");
    synchronized (MTProto.this.contexts) {
        MTProto.this.contexts.remove(context);
        if (!MTProto.this.connectedContexts.contains(contextId)) {
            if (MTProto.this.contextConnectionId.containsKey(contextId)) {
                MTProto.this.exponentalBackoff.onFailureNoWait();
                MTProto.this.connectionRate.onConnectionFailure(MTProto.this.contextConnectionId.get(contextId));
            }
        }
        MTProto.this.contexts.notifyAll();
    }
    MTProto.this.scheduller.onConnectionDies(context.getContextId());
    requestSchedule();
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:21,代码来源:MTProto.java

示例4: suspendConnectionInternal

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
private void suspendConnectionInternal() {
    synchronized (timerSync) {
        if (reconnectTimer != null) {
            reconnectTimer.cancel();
            reconnectTimer = null;
        }
    }
    if ((connectionState == ConnectionState.TcpConnectionStageIdle) || (connectionState == ConnectionState.TcpConnectionStageSuspended)) {
        return;
    }
    Logger.d(TcpContext.this.TAG, "suspend connnection " + TcpContext.this);
    connectionState = ConnectionState.TcpConnectionStageSuspended;
    if (client != null) {
        client.removeListener(TcpContext.this);
        client.dropConnection();
        client = null;
    }
    callback.onChannelBroken(TcpContext.this);
    isFirstPackage = true;
    if (restOfTheData != null) {
        BuffersStorage.getInstance().reuseFreeBuffer(restOfTheData);
        restOfTheData = null;
    }
    lastPacketLength = 0;
    channelToken = 0;
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:27,代码来源:TcpContext.java

示例5: run

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void run() {
    setPriority(Thread.MIN_PRIORITY);
    while (!isClosed) {
        if (Logger.LOG_THREADS) {
            Logger.d(TAG, "Response Iteration");
        }
        synchronized (inQueue) {
            if (inQueue.isEmpty()) {
                try {
                    inQueue.wait();
                } catch (InterruptedException e) {
                    return;
                }
            }
            if (inQueue.isEmpty()) {
                continue;
            }
        }
        MTMessage message = inQueue.poll();
        onMTMessage(message);
        BytesCache.getInstance().put(message.getContent());
    }
}
 
开发者ID:ardock,项目名称:telegram-mt,代码行数:25,代码来源:MTProto.java

示例6: onChannelBroken

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void onChannelBroken(TcpContext context) {
    if (isClosed) {
        return;
    }
    int contextId = context.getContextId();
    Logger.d(TAG, "onChannelBroken (#" + contextId + ")");
    synchronized (contexts) {
        contexts.remove(context);
        if (!connectedContexts.contains(contextId)) {
            if (contextConnectionId.containsKey(contextId)) {
                exponentalBackoff.onFailureNoWait();
                connectionRate.onConnectionFailure(contextConnectionId.get(contextId));
            }
        }
        contexts.notifyAll();
    }
    scheduller.onConnectionDies(context.getContextId());
    requestSchedule();
}
 
开发者ID:ardock,项目名称:telegram-mt,代码行数:21,代码来源:MTProto.java

示例7: skipBytes

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
/**
 * Reading bytes from stream
 *
 * @param count  bytes count
 * @param stream source stream
 * @return readed bytes
 * @throws IOException reading exception
 */
//public static void skipBytes(int count, InputStream stream) throws IOException {
//    stream.skip(count);
//}

public static void skipBytes(int count, InputStream stream) throws IOException {
    byte[] bytes = new byte[count];
    stream.read(bytes);
    Logger.d("SKIPED", "Skypped " + count + " bytes: " + bytes);
    //stream.skip(count);
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:19,代码来源:StreamingUtils.java

示例8: resendAsNewMessageDelayed

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void resendAsNewMessageDelayed(long msgId, long delay) {
    for (SchedullerPackage schedullerPackage : this.messages.values().toArray(new SchedullerPackage[0])) {
        if (schedullerPackage.relatedMessageIds.contains(msgId)) {
            schedullerPackage.idGenerationTime = 0;
            schedullerPackage.dependMessageId = 0;
            schedullerPackage.messageId = 0;
            schedullerPackage.seqNo = 0;
            schedullerPackage.state = STATE_QUEUED;
            schedullerPackage.scheduleTime = getCurrentTime() + delay;
            Logger.d(this.TAG, "Resending as new #" + schedullerPackage.id);
        }
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:14,代码来源:Scheduller.java

示例9: onConnectionDies

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public synchronized void onConnectionDies(int connectionId) {
    Logger.d(this.TAG, "Connection dies " + connectionId);
    for (SchedullerPackage schedullerPackage : this.messages.values().toArray(new SchedullerPackage[0])) {
        if (schedullerPackage.writtenToChannel != connectionId) {
            continue;
        }

        if (schedullerPackage.queuedToChannel != -1) {
            Logger.d(this.TAG, "Removing: #" + schedullerPackage.id + " " + schedullerPackage.supportTag);
            forgetMessage(schedullerPackage.id);
        } else {
            if (schedullerPackage.isRpc) {
                if (schedullerPackage.state == STATE_CONFIRMED || schedullerPackage.state == STATE_QUEUED) {
                    Logger.d(this.TAG, "Re-schedule: #" + schedullerPackage.id + " " + schedullerPackage.supportTag);
                    schedullerPackage.state = STATE_QUEUED;
                    schedullerPackage.lastAttemptTime = 0;
                }
            } else {
                if (schedullerPackage.state == STATE_SENT) {
                    Logger.d(this.TAG, "Re-schedule: #" + schedullerPackage.id + " " + schedullerPackage.supportTag);
                    schedullerPackage.state = STATE_QUEUED;
                    schedullerPackage.lastAttemptTime = 0;
                }
            }

        }
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:29,代码来源:Scheduller.java

示例10: sendMessage

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public int sendMessage(TLObject request, long timeout, boolean isRpc, boolean highPriority) {
    final int id = this.scheduller.postMessage(request, isRpc, timeout, highPriority);
    Logger.d(this.TAG, "sendMessage #" + id + " " + request.toString());
    synchronized (this.scheduller) {
        this.scheduller.notifyAll();
    }

    return id;
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:10,代码来源:MTProto.java

示例11: tryConnection

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public synchronized ConnectionType tryConnection() {
    float value = this.rnd.nextFloat();
    Transport[] currentTransports = this.transports.values().toArray(new Transport[0]);
    Arrays.sort(currentTransports, new Comparator<Transport>() {
        @Override
        public int compare(Transport transport, Transport transport2) {
            return -Float.compare(transport.getRate(), transport2.getRate());
        }
    });
    ConnectionType type = currentTransports[0].getConnectionType();
    Logger.d(TAG, "tryConnection #" + type.getId());
    return type;
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:14,代码来源:TransportRate.java

示例12: reset

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void reset() {
    Logger.d(this.TAG, "reset");
    this.currentFailureCount.set(0);

    synchronized (this) {
        notifyAll();
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:9,代码来源:ExponentalBackoff.java

示例13: onFailure

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void onFailure() throws InterruptedException {
    int val = this.currentFailureCount.incrementAndGet();
    if (val > 50) {
        this.currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
        val = MAX_FAILURE_COUNT;
    }

    int delay = MIN_DELAY + ((MAX_DELAY - MIN_DELAY) / MAX_FAILURE_COUNT) * val;

    synchronized (this) {
        Logger.d(this.TAG, "onFailure: wait " + delay + " ms");
        wait(delay);
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:15,代码来源:ExponentalBackoff.java

示例14: onFailureNoWait

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void onFailureNoWait() {
    Logger.d(this.TAG, "onFailureNoWait");
    int val = this.currentFailureCount.incrementAndGet();
    if (val > 50) {
        this.currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
        val = MAX_FAILURE_COUNT;
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:9,代码来源:ExponentalBackoff.java

示例15: resendAsNewMessageDelayed

import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void resendAsNewMessageDelayed(long msgId, int delay) {
    for (SchedullerPackage schedullerPackage : messages.values().toArray(new SchedullerPackage[0])) {
        if (schedullerPackage.relatedMessageIds.contains(msgId)) {
            schedullerPackage.idGenerationTime = 0;
            schedullerPackage.dependMessageId = 0;
            schedullerPackage.messageId = 0;
            schedullerPackage.seqNo = 0;
            schedullerPackage.state = STATE_QUEUED;
            schedullerPackage.scheduleTime = getCurrentTime() + delay;
            Logger.d(TAG, "Resending as new #" + schedullerPackage.id);
        }
    }
}
 
开发者ID:ardock,项目名称:telegram-mt,代码行数:14,代码来源:Scheduller.java


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