Skip to content

Commit

Permalink
added rest of log wrapper classes and package-info.java
Browse files Browse the repository at this point in the history
  • Loading branch information
fredgrott committed Sep 11, 2010
1 parent e1a49cf commit 4a057cb
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
bin/
local.properties
/local.properties
/local.properties
36 changes: 36 additions & 0 deletions src/com/mobilebytes/andlog/GLLogger.java
@@ -0,0 +1,36 @@
package com.mobilebytes.andlog;

import android.opengl.GLSurfaceView;
import android.opengl.GLSurfaceView.GLWrapper;
import android.util.Log;

//TODO: Auto-generated Javadoc
/**
* The Class GLLogger.
*
* @author fredgrott
*/
public class GLLogger {
/**
* Gl debug.
*
* @param gl
* the gl
* @param glWrapper
* the gl wrapper
* @param debugFlags
* the debug flags
* @param logTag
* the lO g_ tag
*/
public final void glDebug(GLSurfaceView gl,
GLWrapper glWrapper, int debugFlags, String logTag) {
if (Log.isLoggable(logTag, Log.DEBUG)) {
gl.setGLWrapper(glWrapper);
gl.setDebugFlags(debugFlags);

} else {
CustomLogger.i(logTag, "Log.d not enabled");
}
}
}
39 changes: 39 additions & 0 deletions src/com/mobilebytes/andlog/PerfLogger.java
@@ -0,0 +1,39 @@
package com.mobilebytes.andlog;

//TODO: Auto-generated Javadoc
/**
* The Class PerfLogger.
*
* @author fredgrott
*/
public class PerfLogger {
/** The Constant MILLISECONDSPERSECOND. */
private static final int MILLISECONDSPERSECOND = 1000;
/** The start time. */
private static long startTime = 0;

/**
* Start.
*
* @param tagName
* the tag name
*/
public static void start(String tagName) {
startTime = System.currentTimeMillis();
CustomLogger.d(tagName, "started PerfLogger");
}

/**
* Stop.
*
* @param tagName
* the tag name
*/
public static void stop(String tagName) {
double d = (System.currentTimeMillis() - startTime)
/ MILLISECONDSPERSECOND;
CustomLogger.d(tagName, "Fine PerfTrace\nTag: " + tagName
+ "\nTime spent: " + d + " s.");
}

}
6 changes: 6 additions & 0 deletions src/com/mobilebytes/andlog/package-info.java
@@ -0,0 +1,6 @@
/**
* Log wrapper containing CustomLogger, GLLogger, and PerfLogger.
* @author fredgrott
* @since Android 1.5
*/
package com.mobilebytes.andlog;

0 comments on commit 4a057cb

Please sign in to comment.