android.util.Log.w()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中android.util.Log.w()方法的一些代码示例,展示了Log.w()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.w()方法的具体详情如下:
包路径:android.util.Log
类名称:Log
方法名:w

Log.w介绍

[英]Logs a warning message to the console.
[中]将警告消息记录到控制台。

代码示例

代码示例来源:origin: airbnb/lottie-android

/**
 * Warn to logcat. Keeps track of messages so they are only logged once ever.
 */
public static void warn(String msg) {
 if (loggedMessages.contains(msg)) {
  return;
 }
 Log.w(TAG, msg);
 loggedMessages.add(msg);
}

代码示例来源:origin: libgdx/libgdx

private void printConfigs (EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
  int numConfigs = configs.length;
  Log.w(TAG, String.format("%d configurations", numConfigs));
  for (int i = 0; i < numConfigs; i++) {
    Log.w(TAG, String.format("Configuration %d:\n", i));
    printConfig(egl, display, configs[i]);
  }
}

代码示例来源:origin: libgdx/libgdx

private void printConfigs (EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
  int numConfigs = configs.length;
  Log.w(TAG, String.format("%d configurations", numConfigs));
  for (int i = 0; i < numConfigs; i++) {
    Log.w(TAG, String.format("Configuration %d:\n", i));
    printConfig(egl, display, configs[i]);
  }
}

代码示例来源:origin: libgdx/libgdx

private void printConfigs (EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
  int numConfigs = configs.length;
  Log.w(TAG, String.format("%d configurations", numConfigs));
  for (int i = 0; i < numConfigs; i++) {
    Log.w(TAG, String.format("Configuration %d:\n", i));
    printConfig(egl, display, configs[i]);
  }
}

代码示例来源:origin: libgdx/libgdx

private void printConfigs (EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
  int numConfigs = configs.length;
  Log.w(TAG, String.format("%d configurations", numConfigs));
  for (int i = 0; i < numConfigs; i++) {
    Log.w(TAG, String.format("Configuration %d:\n", i));
    printConfig(egl, display, configs[i]);
  }
}

代码示例来源:origin: airbnb/lottie-android

public FontAssetManager(Drawable.Callback callback, @Nullable FontAssetDelegate delegate) {
 this.delegate = delegate;
 if (!(callback instanceof View)) {
  Log.w(L.TAG, "LottieDrawable must be inside of a view for images to work.");
  assetManager = null;
  return;
 }
 assetManager = ((View) callback).getContext().getAssets();
}

代码示例来源:origin: libgdx/libgdx

private void printConfigs (EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
  int numConfigs = configs.length;
  Log.w(TAG, String.format("%d configurations", numConfigs));
  for (int i = 0; i < numConfigs; i++) {
    Log.w(TAG, String.format("Configuration %d:\n", i));
    printConfig(egl, display, configs[i]);
  }
}

代码示例来源:origin: libgdx/libgdx

private void printConfigs (EGL10 egl, EGLDisplay display, EGLConfig[] configs) {
  int numConfigs = configs.length;
  Log.w(TAG, String.format("%d configurations", numConfigs));
  for (int i = 0; i < numConfigs; i++) {
    Log.w(TAG, String.format("Configuration %d:\n", i));
    printConfig(egl, display, configs[i]);
  }
}

代码示例来源:origin: libgdx/libgdx

public void destroySurface() {
  if (LOG_EGL) {
    Log.w("EglHelper", "destroySurface()  tid=" + Thread.currentThread().getId());
  }
  destroySurfaceImp();
}

代码示例来源:origin: libgdx/libgdx

public void destroySurface() {
  if (LOG_EGL) {
    Log.w("EglHelper", "destroySurface()  tid=" + Thread.currentThread().getId());
  }
  destroySurfaceImp();
}

代码示例来源:origin: bumptech/glide

private boolean writeDataDirect(ByteBuffer data, File file) {
 try {
  ByteBufferUtil.toFile(data, file);
 } catch (IOException e) {
  if (Log.isLoggable(TAG, Log.WARN)) {
   Log.w(TAG, "Failed to write GIF data", e);
  }
  return false;
 }
 return true;
}

代码示例来源:origin: airbnb/lottie-android

@RestrictTo(RestrictTo.Scope.LIBRARY)
public void addWarning(String warning) {
 Log.w(L.TAG, warning);
 warnings.add(warning);
}

代码示例来源:origin: airbnb/lottie-android

private void notifyFailureListeners(Throwable e) {
 // Allows listeners to remove themselves in onResult.
 // Otherwise we risk ConcurrentModificationException.
 List<LottieListener<Throwable>> listenersCopy = new ArrayList<>(failureListeners);
 if (listenersCopy.isEmpty()) {
  Log.w(L.TAG, "Lottie encountered an error but no failure listener was added.", e);
  return;
 }
 for (LottieListener<Throwable> l : listenersCopy) {
  l.onResult(e);
 }
}

代码示例来源:origin: libgdx/libgdx

public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
  Log.w(TAG, "creating OpenGL ES " + GLSurfaceView20.targetGLESVersion + ".0 context");
  checkEglError("Before eglCreateContext "+targetGLESVersion, egl);
  int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, GLSurfaceView20.targetGLESVersion, EGL10.EGL_NONE};
  EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
  boolean success = checkEglError("After eglCreateContext "+targetGLESVersion, egl);
  if ((!success || context == null) && GLSurfaceView20.targetGLESVersion > 2) {
    Log.w(TAG, "Falling back to GLES 2");
    GLSurfaceView20.targetGLESVersion = 2;
    return createContext(egl, display, eglConfig);
  }
  Log.w(TAG, "Returning a GLES "+targetGLESVersion+" context");
  return context;
}

代码示例来源:origin: bumptech/glide

@Override
public void onAttach(Context context) {
 super.onAttach(context);
 try {
  registerFragmentWithRoot(getActivity());
 } catch (IllegalStateException e) {
  // OnAttach can be called after the activity is destroyed, see #497.
  if (Log.isLoggable(TAG, Log.WARN)) {
   Log.w(TAG, "Unable to register fragment with root", e);
  }
 }
}

代码示例来源:origin: bumptech/glide

public void cycleScaleType(View v) {
 ImageView.ScaleType curr = imageViewRes.getScaleType();
 Log.w(TAG, "cycle: current=" + curr);
 ImageView.ScaleType[] all = ImageView.ScaleType.values();
 int nextOrdinal = (curr.ordinal() + 1) % all.length;
 ImageView.ScaleType next = all[nextOrdinal];
 Log.w(TAG, "cycle: next=" + next);
 imageViewRes.setScaleType(next);
 imageViewNet.setScaleType(next);
 reload();
}

代码示例来源:origin: bumptech/glide

@Override
public void delete(Key key) {
 String safeKey = safeKeyGenerator.getSafeKey(key);
 try {
  getDiskCache().remove(safeKey);
 } catch (IOException e) {
  if (Log.isLoggable(TAG, Log.WARN)) {
   Log.w(TAG, "Unable to delete from disk cache", e);
  }
 }
}

代码示例来源:origin: libgdx/libgdx

public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
  Log.w(TAG, "creating OpenGL ES 2.0 context");
  checkEglError("Before eglCreateContext", egl);
  int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
  EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
  checkEglError("After eglCreateContext", egl);
  return context;
}

代码示例来源:origin: libgdx/libgdx

public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
  Log.w(TAG, "creating OpenGL ES 2.0 context");
  checkEglError("Before eglCreateContext", egl);
  int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
  EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
  checkEglError("After eglCreateContext", egl);
  return context;
}

代码示例来源:origin: bumptech/glide

private void reload() {
 Log.w(TAG, "reloading");
 ((TextView) findViewById(R.id.button))
   .setText(getString(R.string.scaleType, imageViewRes.getScaleType()));
 loadRes();
 loadNet();
}

相关文章

微信公众号

最新文章

更多