當前位置: 首頁>>代碼示例>>Java>>正文


Java Log.e方法代碼示例

本文整理匯總了Java中ua.at.tsvetkov.util.Log.e方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.e方法的具體用法?Java Log.e怎麽用?Java Log.e使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ua.at.tsvetkov.util.Log的用法示例。


在下文中一共展示了Log.e方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toString

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Return composed URL string from parts or null if not builded
 */
@Override
public String toString() {
   if (sb != null) {
      if (configuration.isCheckingRequestStringEnabled()) {
         try {
            return URLEncoder.encode(sb.toString(), encoding);
         } catch (UnsupportedEncodingException e) {
            Log.e(WRONG_URL, e);
            return "";
         }
      } else {
         return sb.toString();
      }
   } else {
      if (configuration.isLogEnabled()) {
         Log.w(REQUEST_IS_NOT_BUILD);
      }
      return null;
   }
}
 
開發者ID:lordtao,項目名稱:android-tao-rest-data-processor,代碼行數:24,代碼來源:Request.java

示例2: fromInputStream

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Computes and returns the final hash value for this InputStream data
 *
 * @param in InputStream
 * @return null if has error or hash value
 */
public static byte[] fromInputStream(InputStream in) {
   MessageDigest digester;
   try {
      digester = MessageDigest.getInstance("MD5");
      byte[] bytes = new byte[8192];
      int byteCount;
      while ((byteCount = in.read(bytes)) > 0) {
         digester.update(bytes, 0, byteCount);
      }
      return digester.digest();
   } catch (Exception e) {
      Log.e(e);
   }
   return null;
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:22,代碼來源:Md5.java

示例3: deleteDir

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Delete directory with a subdirs and a files
 *
 * @param dir directory for delete
 * @return tue if success
 */
public static boolean deleteDir(File dir) {
   if (dir == null) {
      Log.e("Directory eq null - can't delete.");
      return false;
   }
   if (dir.isDirectory()) {
      String[] children = dir.list();
      for (String element : children) {
         boolean success = deleteDir(new File(dir, element));
         if (!success) {
            return false;
         }
      }
   }
   return dir.delete();
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:23,代碼來源:FileIO.java

示例4: getFileLength

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Returns the content length in bytes specified by the response header field content-length or -1 if this field is not set.
 *
 * @param url url path to file
 * @return the value of the response header field content-length
 */
static public int getFileLength(String url) {
   HttpURLConnection conn = null;
   int length = 0;
   try {
      conn = (HttpURLConnection) new URL(url).openConnection();
      conn.setRequestProperty("keep-alive", "false");
      conn.setDoInput(true);
      conn.setConnectTimeout(TIMEOUT);
      conn.connect();
      length = conn.getContentLength();
   } catch (Exception e) {
      Log.e(e);
   } finally {
      if (conn != null)
         conn.disconnect();
   }
   return length;
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:25,代碼來源:FileInet.java

示例5: getStatusCode

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
@Override
public int getStatusCode() {
   try {
      statusCode = httpURLConnection.getResponseCode();
   } catch (IOException e) {
      Log.e("IO error during the retrieval response code.", e);
      statusCode = ConnectionConstants.NO_INTERNET_CONNECTION;
   }
   return statusCode;
}
 
開發者ID:lordtao,項目名稱:android-tao-rest-data-processor,代碼行數:11,代碼來源:WebRequest.java

示例6: getStatusMessage

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
@Override
public String getStatusMessage() {
   String message = "";
   try {
      message = httpURLConnection.getResponseMessage();
   } catch (IOException e) {
      Log.e("IO error during the retrieval response message.", e);
      message = "No internet connection.";
   }
   return message;
}
 
開發者ID:lordtao,項目名稱:android-tao-rest-data-processor,代碼行數:12,代碼來源:WebRequest.java

示例7: getURL

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Generate URL
 *
 * @return URL
 */
public URL getURL() {
   try {
      return new URL(toString());
   } catch (MalformedURLException e) {
      Log.e(WRONG_URL, e);
      return null;
   }
}
 
開發者ID:lordtao,項目名稱:android-tao-rest-data-processor,代碼行數:14,代碼來源:Request.java

示例8: getApplicationSignatureKeyHash

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Return the KeyHash for the application
 *
 * @param context     the application Context
 * @param packageName a package name
 */
public static String getApplicationSignatureKeyHash(Context context, String packageName) {
   try {
      PackageInfo info = context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
      for (Signature signature : info.signatures) {
         MessageDigest md = MessageDigest.getInstance("SHA");
         md.update(signature.toByteArray());
         return Base64.encodeToString(md.digest(), Base64.DEFAULT);
      }
   } catch (Exception e) {
      Log.e(e);
   }
   return "";
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:20,代碼來源:Apps.java

示例9: fromFile

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Computes and returns the final hash value for file data
 *
 * @param fileName path to file
 * @return null if has error or hash value
 */
public static byte[] fromFile(String fileName) {
   try {
      InputStream in = new FileInputStream(fileName);
      return fromInputStream(in);
   } catch (FileNotFoundException e) {
      Log.e(e);
   }
   return null;
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:16,代碼來源:Md5.java

示例10: copy

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Copy file from source to destination
 *
 * @param srcFileName source file name
 * @param dstFile     destination file
 * @return true if success
 */
public static boolean copy(@NonNull String srcFileName, @NonNull File dstFile) {
   if (srcFileName == null || srcFileName.length() == 0) {
      Log.e("Source file name is empty.");
      return false;
   }
   if (dstFile == null) {
      Log.e("Destination file is null.");
      return false;
   }
   return copy(srcFileName, dstFile.getAbsoluteFile());
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:19,代碼來源:FileIO.java

示例11: copyAsset

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Copy file from assets source to destination
 *
 * @param context        base app context
 * @param assetsFileName assets file name
 * @param dstFile        destination of copy
 * @return true if success
 */
public static boolean copyAsset(@NonNull Context context, @NonNull String assetsFileName, @NonNull File dstFile) {
   if (assetsFileName == null || assetsFileName.length() == 0) {
      Log.e("Assets file name is empty.");
      return false;
   }
   if (dstFile == null) {
      Log.e("Destination file is null.");
      return false;
   }
   return copyAsset(context, assetsFileName, dstFile.getAbsolutePath());
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:20,代碼來源:FileIO.java

示例12: getFileNameNoExtension

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Return file name without extension
 *
 * @param path full path to file
 * @return file name without extension
 */
public static String getFileNameNoExtension(String path) {
   String name = "";
   try {
      int pos = path.lastIndexOf(File.separator) + 1;
      int dotPos = path.lastIndexOf(".") + 1;
      name = path.substring(pos, dotPos);
   } catch (Exception e) {
      Log.e(e);
   }
   return name;
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:18,代碼來源:FileIO.java

示例13: onFinish

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
@Override
public void onFinish(MonarchArray items, int what) {
   acMainProgressLayout.setVisibility(View.GONE);
   if (what == HttpStatus.SC_OK) {
      adapter.init(items);
      Log.i("MONARCH LOADED");
   } else {
      Log.e("Error, What=" + what);
   }
}
 
開發者ID:lordtao,項目名稱:android-tao-data-processor-example,代碼行數:11,代碼來源:AcMain.java

示例14: init

import ua.at.tsvetkov.util.Log; //導入方法依賴的package包/類
/**
 * Init configuration.
 *
 * @param application the Application
 * @throws NumberFormatException
 */
public static void init(Application application) {
   mPackageName = application.getApplicationInfo().packageName;
   PackageInfo appData = null;
   try {
      appData = application.getPackageManager().getPackageInfo(application.getPackageName(), PackageManager.GET_SIGNATURES);
   } catch (NameNotFoundException e) {
      Log.e("Package not found", e);
   }
   mPreferences = PreferenceManager.getDefaultSharedPreferences(application);
   mEditor = mPreferences.edit();
   mAppName = application.getString(appData.applicationInfo.labelRes);
   isNewApplication = (mPreferences.getInt(APP_VERSION_CODE, -1) < 0);
   if (appData.versionCode > mPreferences.getInt(APP_VERSION_CODE, 0)) {
      isNewVersion = true;
   }

   PointF pf = Screen.getSizeInInch(application);
   double diag = Math.sqrt(pf.x * pf.x + pf.y * pf.y);
   if (diag < 6) {
      mDiagonal = Diagonal.PHONE;
   } else if (diag >= 6 && diag < 8) {
      mDiagonal = Diagonal.TABLET_7;
   } else if (diag >= 8 && diag < 11) {
      mDiagonal = Diagonal.TABLET_10;
   } else {
      mDiagonal = Diagonal.TABLET_BIG;
   }

   mAppSignatureKeyHash = Apps.getApplicationSignatureKeyHash(application, mPackageName);
   mAppSignatureFingerprint = Apps.getSignatureFingerprint(application, mPackageName);

   mAppVersionName = appData.versionName;
   mAppVersionCode = appData.versionCode;
   mAndroidId = Settings.Secure.getString(application.getContentResolver(), Settings.Secure.ANDROID_ID);

   mEditor.putString(ANDROID_ID, mAndroidId);
   mEditor.putString(APP_NAME, mAppName);
   mEditor.putString(APP_VERSION_NAME, mAppVersionName);
   mEditor.putString(APP_PACKAGE_NAME, mPackageName);
   mEditor.putInt(APP_VERSION_CODE, mAppVersionCode);
   mEditor.putBoolean(NEW_VERSION, isNewVersion);
   mEditor.putBoolean(NEW_INSTALL, isNewApplication);
   save();

   isDebuggable = (0 != (application.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
   isBeingDebugged = android.os.Debug.isDebuggerConnected();
   if (isDebuggable) {
      android.util.Log.i(DIV_LEFT + mAppName + DIV_RIGHT, "➧ Log enabled.");
   } else {
      android.util.Log.w(DIV_LEFT + mAppName + DIV_RIGHT, "➧ Log is prohibited because debug mode is disabled.");
      Log.setDisabled(true);
   }

   AppResources.init(application);
   isInitialized = true;
}
 
開發者ID:lordtao,項目名稱:android-tao-core,代碼行數:63,代碼來源:AppConfig.java


注:本文中的ua.at.tsvetkov.util.Log.e方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。