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


Java Log.e方法代码示例

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


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

示例1: closeCacheInternal

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
@Override
protected void closeCacheInternal() {
    super.closeCacheInternal();
    synchronized (mHttpDiskCacheLock) {
        if (mHttpDiskCache != null) {
            try {
                if (!mHttpDiskCache.isClosed()) {
                    mHttpDiskCache.close();
                    mHttpDiskCache = null;
                    if (BuildConfig.DEBUG) {
                        Log.d(TAG, "HTTP cache closed");
                    }
                }
            } catch (IOException e) {
                Log.e(TAG, "closeCacheInternal - " + e);
            }
        }
    }
}
 
开发者ID:jjuiddong,项目名称:Android-Practice,代码行数:20,代码来源:ImageFetcher.java

示例2: ConnectThread

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public ConnectThread(BluetoothDevice device, boolean secure) {
    mmDevice = device;
    BluetoothSocket tmp = null;
    mSocketType = secure ? "Secure" : "Insecure";

    // Get a BluetoothSocket for a connection with the
    // given BluetoothDevice
    try {
        if (secure) {
            tmp = device.createRfcommSocketToServiceRecord(
                    MY_UUID_SECURE);
        } else {
            tmp = device.createInsecureRfcommSocketToServiceRecord(
                    MY_UUID_INSECURE);
        }
    } catch (IOException e) {
        Log.e(TAG, "Socket Type: " + mSocketType + "create() failed", e);
    }
    mmSocket = tmp;
    mState = STATE_CONNECTING;
}
 
开发者ID:hardik-dadhich,项目名称:bluetooth-chat-appliction,代码行数:22,代码来源:BluetoothChatService.java

示例3: ConnectThread

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public ConnectThread(BluetoothDevice device, boolean secure) {
    mmDevice = device;
    BluetoothSocket tmp = null;
    mSocketType = "Insecure";

    // Get a BluetoothSocket for a connection with the
    // given BluetoothDevice
    try {
        tmp = device.createInsecureRfcommSocketToServiceRecord(
                    MY_UUID_INSECURE);

    } catch (IOException e) {
        Log.e(TAG, "Socket Type: " + mSocketType + "create() failed", e);
    }
    mmSocket = tmp;
    mState = STATE_CONNECTING;
}
 
开发者ID:alexmerz,项目名称:dab-iot,代码行数:18,代码来源:BluetoothChatService.java

示例4: clearCacheInternal

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
@Override
protected void clearCacheInternal() {
    super.clearCacheInternal();
    synchronized (mHttpDiskCacheLock) {
        if (mHttpDiskCache != null && !mHttpDiskCache.isClosed()) {
            try {
                mHttpDiskCache.delete();
                if (BuildConfig.DEBUG) {
                    Log.d(TAG, "HTTP cache cleared");
                }
            } catch (IOException e) {
                Log.e(TAG, "clearCacheInternal - " + e);
            }
            mHttpDiskCache = null;
            mHttpDiskCacheStarting = true;
            initHttpDiskCache();
        }
    }
}
 
开发者ID:jjuiddong,项目名称:Android-Practice,代码行数:20,代码来源:ImageFetcher.java

示例5: flushCacheInternal

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
@Override
protected void flushCacheInternal() {
    super.flushCacheInternal();
    synchronized (mHttpDiskCacheLock) {
        if (mHttpDiskCache != null) {
            try {
                mHttpDiskCache.flush();
                if (BuildConfig.DEBUG) {
                    Log.d(TAG, "HTTP cache flushed");
                }
            } catch (IOException e) {
                Log.e(TAG, "flush - " + e);
            }
        }
    }
}
 
开发者ID:jjuiddong,项目名称:Android-Practice,代码行数:17,代码来源:ImageFetcher.java

示例6: close

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
/**
 * Closes the disk cache associated with this ImageCache object. Note that this includes
 * disk access so this should not be executed on the main/UI thread.
 */
public void close() {
    synchronized (mDiskCacheLock) {
        if (mDiskLruCache != null) {
            try {
                if (!mDiskLruCache.isClosed()) {
                    mDiskLruCache.close();
                    mDiskLruCache = null;
                    if (BuildConfig.DEBUG) {
                        Log.d(TAG, "Disk cache closed");
                    }
                }
            } catch (IOException e) {
                Log.e(TAG, "close - " + e);
            }
        }
    }
}
 
开发者ID:gavinking,项目名称:DisplayingBitmaps,代码行数:22,代码来源:ImageCache.java

示例7: ConnectedThread

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public ConnectedThread(BluetoothSocket socket, String socketType) {
    Log.d(TAG, "create ConnectedThread: " + socketType);
    mmSocket = socket;
    InputStream tmpIn = null;
    OutputStream tmpOut = null;

    // Get the BluetoothSocket input and output streams
    try {
        tmpIn = socket.getInputStream();
        tmpOut = socket.getOutputStream();
    } catch (IOException e) {
        Log.e(TAG, "temp sockets not created", e);
    }

    mmInStream = tmpIn;
    mmOutStream = tmpOut;
    mState = STATE_CONNECTED;
}
 
开发者ID:alexmerz,项目名称:dab-iot,代码行数:19,代码来源:BluetoothChatService.java

示例8: cancel

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public void cancel() {
    try {
        mmSocket.close();
    } catch (IOException e) {
        Log.e(TAG, "close() of connect socket failed", e);
    }
}
 
开发者ID:alexmerz,项目名称:dab-iot,代码行数:8,代码来源:BluetoothChatService.java

示例9: write

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
/**
 * Write to the connected OutStream.
 *
 * @param buffer The bytes to write
 */
public void write(byte[] buffer) {
    try {
        mmOutStream.write(buffer);

        // Share the sent message back to the UI Activity
        mHandler.obtainMessage(Constants.MESSAGE_WRITE, -1, -1, buffer)
                .sendToTarget();
    } catch (IOException e) {
        Log.e(TAG, "Exception during write", e);
    }
}
 
开发者ID:hardik-dadhich,项目名称:bluetooth-chat-appliction,代码行数:17,代码来源:BluetoothChatService.java

示例10: initDiskCache

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
/**
 * Initializes the disk cache.  Note that this includes disk access so this should not be
 * executed on the main/UI thread. By default an ImageCache does not initialize the disk
 * cache when it is created, instead you should call initDiskCache() to initialize it on a
 * background thread.
 */
public void initDiskCache() {
    // Set up disk cache
    synchronized (mDiskCacheLock) {
        if (mDiskLruCache == null || mDiskLruCache.isClosed()) {
            File diskCacheDir = mCacheParams.diskCacheDir;
            if (mCacheParams.diskCacheEnabled && diskCacheDir != null) {
                if (!diskCacheDir.exists()) {
                    diskCacheDir.mkdirs();
                }
                if (getUsableSpace(diskCacheDir) > mCacheParams.diskCacheSize) {
                    try {
                        mDiskLruCache = DiskLruCache.open(
                                diskCacheDir, 1, 1, mCacheParams.diskCacheSize);
                        if (BuildConfig.DEBUG) {
                            Log.d(TAG, "Disk cache initialized");
                        }
                    } catch (final IOException e) {
                        mCacheParams.diskCacheDir = null;
                        Log.e(TAG, "initDiskCache - " + e);
                    }
                }
            }
        }
        mDiskCacheStarting = false;
        mDiskCacheLock.notifyAll();
    }
}
 
开发者ID:jjuiddong,项目名称:Android-Practice,代码行数:34,代码来源:ImageCache.java

示例11: run

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public void run() {
    Log.i(TAG, "BEGIN mConnectThread SocketType:" + mSocketType);
    setName("ConnectThread" + mSocketType);

    // Always cancel discovery because it will slow down a connection
    mAdapter.cancelDiscovery();

    // Make a connection to the BluetoothSocket
    try {
        // This is a blocking call and will only return on a
        // successful connection or an exception
        mmSocket.connect();
    } catch (IOException e) {
        // Close the socket
        try {
            mmSocket.close();
        } catch (IOException e2) {
            Log.e(TAG, "unable to close() " + mSocketType +
                    " socket during connection failure", e2);
        }
        connectionFailed();
        return;
    }

    // Reset the ConnectThread because we're done
    synchronized (BluetoothChatService.this) {
        mConnectThread = null;
    }

    // Start the connected thread
    connected(mmSocket, mmDevice, mSocketType);
}
 
开发者ID:alexmerz,项目名称:dab-iot,代码行数:33,代码来源:BluetoothChatService.java

示例12: cancel

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public void cancel() {
    try {
        mmSocket.close();
    } catch (IOException e) {
        Log.e(TAG, "close() of connect " + mSocketType + " socket failed", e);
    }
}
 
开发者ID:tkmarsh,项目名称:SmartRC,代码行数:8,代码来源:BluetoothChatService.java

示例13: AcceptThread

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
public AcceptThread(boolean secure) {
    BluetoothServerSocket tmp = null;
    mSocketType = "Insecure";

    // Create a new listening server socket
    try {
        tmp = mAdapter.listenUsingInsecureRfcommWithServiceRecord(
                    NAME_INSECURE, MY_UUID_INSECURE);

    } catch (IOException e) {
        Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
    }
    mmServerSocket = tmp;
    mState = STATE_LISTEN;
}
 
开发者ID:alexmerz,项目名称:dab-iot,代码行数:16,代码来源:BluetoothChatService.java

示例14: flush

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
/**
 * Flushes the disk cache associated with this ImageCache object. Note that this includes
 * disk access so this should not be executed on the main/UI thread.
 */
public void flush() {
    synchronized (mDiskCacheLock) {
        if (mDiskLruCache != null) {
            try {
                mDiskLruCache.flush();
                if (BuildConfig.DEBUG) {
                    Log.d(TAG, "Disk cache flushed");
                }
            } catch (IOException e) {
                Log.e(TAG, "flush - " + e);
            }
        }
    }
}
 
开发者ID:gavinking,项目名称:DisplayingBitmaps,代码行数:19,代码来源:ImageCache.java

示例15: checkConnection

import com.example.android.common.logger.Log; //导入方法依赖的package包/类
/**
* Simple network connection check.
*
* @param context
*/
private void checkConnection(Context context) {
    final ConnectivityManager cm =
            (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    final NetworkInfo networkInfo = cm.getActiveNetworkInfo();
    if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {
        Toast.makeText(context, R.string.no_network_connection_toast, Toast.LENGTH_LONG).show();
        Log.e(TAG, "checkConnection - no connection found");
    }
}
 
开发者ID:jjuiddong,项目名称:Android-Practice,代码行数:15,代码来源:ImageFetcher.java


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