mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
converting to use standard TAG-based logging
First files done manually: add TAG to file and pass it rather than class to log wrapper. Rest will be done with a script.
This commit is contained in:
parent
97c1091d0c
commit
49d75d5d91
2 changed files with 41 additions and 15 deletions
|
@ -74,6 +74,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
DwnldDelegate.DownloadFinishedListener,
|
DwnldDelegate.DownloadFinishedListener,
|
||||||
ConnStatusHandler.ConnStatusCBacks,
|
ConnStatusHandler.ConnStatusCBacks,
|
||||||
NFCUtils.NFCActor {
|
NFCUtils.NFCActor {
|
||||||
|
private static final String TAG = BoardDelegate.class.getSimpleName();
|
||||||
|
|
||||||
public static final String INTENT_KEY_CHAT = "chat";
|
public static final String INTENT_KEY_CHAT = "chat";
|
||||||
|
|
||||||
|
@ -567,7 +568,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
|
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, -1 );
|
m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, -1 );
|
||||||
DbgUtils.logi( getClass(), "opening rowid %d", m_rowid );
|
DbgUtils.logi( TAG, "opening rowid %d", m_rowid );
|
||||||
m_haveInvited = args.getBoolean( GameUtils.INVITED, false );
|
m_haveInvited = args.getBoolean( GameUtils.INVITED, false );
|
||||||
m_overNotShown = true;
|
m_overNotShown = true;
|
||||||
|
|
||||||
|
@ -706,7 +707,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
@Override
|
@Override
|
||||||
public void orientationChanged()
|
public void orientationChanged()
|
||||||
{
|
{
|
||||||
DbgUtils.logd( getClass(), "BoardDelegate.orientationChanged()" );
|
DbgUtils.logd( TAG, "BoardDelegate.orientationChanged()" );
|
||||||
initToolbar();
|
initToolbar();
|
||||||
m_view.orientationChanged();
|
m_view.orientationChanged();
|
||||||
}
|
}
|
||||||
|
@ -960,7 +961,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DbgUtils.logw( getClass(), "menuitem %d not handled", id );
|
DbgUtils.logw( TAG, "menuitem %d not handled", id );
|
||||||
handled = false;
|
handled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -979,7 +980,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
{
|
{
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
boolean positive = AlertDialog.BUTTON_POSITIVE == which;
|
boolean positive = AlertDialog.BUTTON_POSITIVE == which;
|
||||||
DbgUtils.logd( getClass(), "BoardDelegate.dlgButtonClicked(%s, %b)",
|
DbgUtils.logd( TAG, "BoardDelegate.dlgButtonClicked(%s, %b)",
|
||||||
action.toString(), positive );
|
action.toString(), positive );
|
||||||
|
|
||||||
if ( Action.ENABLE_RELAY_DO_OR == action ) {
|
if ( Action.ENABLE_RELAY_DO_OR == action ) {
|
||||||
|
@ -1188,7 +1189,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
// This can be BT or SMS. In BT case there's a progress
|
// This can be BT or SMS. In BT case there's a progress
|
||||||
// thing going. Not in SMS case.
|
// thing going. Not in SMS case.
|
||||||
case NEWGAME_FAILURE:
|
case NEWGAME_FAILURE:
|
||||||
DbgUtils.logw( getClass(), "failed to create game" );
|
DbgUtils.logw( TAG, "failed to create game" );
|
||||||
break;
|
break;
|
||||||
case NEWGAME_DUP_REJECTED:
|
case NEWGAME_DUP_REJECTED:
|
||||||
if ( m_progressShown ) {
|
if ( m_progressShown ) {
|
||||||
|
@ -1346,7 +1347,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
nli.addP2PInfo( m_activity );
|
nli.addP2PInfo( m_activity );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DbgUtils.logw( getClass(), "Not doing NFC join for conn type %s",
|
DbgUtils.logw( TAG, "Not doing NFC join for conn type %s",
|
||||||
typ.toString() );
|
typ.toString() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1568,7 +1569,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( null != toastStr ) {
|
if ( null != toastStr ) {
|
||||||
DbgUtils.logi( getClass(), "handleConndMessage(): toastStr: %s", toastStr );
|
DbgUtils.logi( TAG, "handleConndMessage(): toastStr: %s", toastStr );
|
||||||
m_toastStr = toastStr;
|
m_toastStr = toastStr;
|
||||||
if ( naMsg == 0 ) {
|
if ( naMsg == 0 ) {
|
||||||
dlgButtonClicked( Action.SHOW_EXPL_ACTION,
|
dlgButtonClicked( Action.SHOW_EXPL_ACTION,
|
||||||
|
@ -2174,7 +2175,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
case COMMS_CONN_P2P:
|
case COMMS_CONN_P2P:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DbgUtils.logw( getClass(), "tickle: unexpected type %s",
|
DbgUtils.logw( TAG, "tickle: unexpected type %s",
|
||||||
typ.toString() );
|
typ.toString() );
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
}
|
}
|
||||||
|
@ -2270,7 +2271,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
int result = cancelResult;
|
int result = cancelResult;
|
||||||
// this has been true; dunno why
|
// this has been true; dunno why
|
||||||
if ( DlgID.NONE != m_blockingDlgID ) {
|
if ( DlgID.NONE != m_blockingDlgID ) {
|
||||||
DbgUtils.logw( getClass(), "waitBlockingDialog: dropping dlgID %d b/c %d set",
|
DbgUtils.logw( TAG, "waitBlockingDialog: dropping dlgID %d b/c %d set",
|
||||||
dlgID, m_blockingDlgID );
|
dlgID, m_blockingDlgID );
|
||||||
} else {
|
} else {
|
||||||
setBlockingThread();
|
setBlockingThread();
|
||||||
|
@ -2548,7 +2549,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
if ( canPost ) {
|
if ( canPost ) {
|
||||||
m_handler.post( runnable );
|
m_handler.post( runnable );
|
||||||
} else {
|
} else {
|
||||||
DbgUtils.logw( getClass(), "post(): dropping b/c handler null" );
|
DbgUtils.logw( TAG, "post(): dropping b/c handler null" );
|
||||||
DbgUtils.printStack();
|
DbgUtils.printStack();
|
||||||
}
|
}
|
||||||
return canPost;
|
return canPost;
|
||||||
|
@ -2559,7 +2560,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
if ( null != m_handler ) {
|
if ( null != m_handler ) {
|
||||||
m_handler.postDelayed( runnable, when );
|
m_handler.postDelayed( runnable, when );
|
||||||
} else {
|
} else {
|
||||||
DbgUtils.logw( getClass(), "postDelayed: dropping %d because handler null", when );
|
DbgUtils.logw( TAG, "postDelayed: dropping %d because handler null", when );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2568,7 +2569,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
if ( null != m_handler ) {
|
if ( null != m_handler ) {
|
||||||
m_handler.removeCallbacks( which );
|
m_handler.removeCallbacks( which );
|
||||||
} else {
|
} else {
|
||||||
DbgUtils.logw( getClass(), "removeCallbacks: dropping %h because handler null",
|
DbgUtils.logw( TAG, "removeCallbacks: dropping %h because handler null",
|
||||||
which );
|
which );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2781,7 +2782,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
sendSMSInviteIf( (String)params[1], (NetLaunchInfo)params[0],
|
sendSMSInviteIf( (String)params[1], (NetLaunchInfo)params[0],
|
||||||
false );
|
false );
|
||||||
} else {
|
} else {
|
||||||
DbgUtils.logw( getClass(), "retrySMSInvites: tests failed" );
|
DbgUtils.logw( TAG, "retrySMSInvites: tests failed" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2793,7 +2794,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
private void handleViaThread( JNICmd cmd, Object... args )
|
private void handleViaThread( JNICmd cmd, Object... args )
|
||||||
{
|
{
|
||||||
if ( null == m_jniThread ) {
|
if ( null == m_jniThread ) {
|
||||||
DbgUtils.logw( getClass(), "not calling handle(%s)", cmd.toString() );
|
DbgUtils.logw( TAG, "not calling handle(%s)", cmd.toString() );
|
||||||
DbgUtils.printStack();
|
DbgUtils.printStack();
|
||||||
} else {
|
} else {
|
||||||
m_jniThread.handle( cmd, args );
|
m_jniThread.handle( cmd, args );
|
||||||
|
|
|
@ -54,7 +54,8 @@ public class DbgUtils {
|
||||||
logEnable( on );
|
logEnable( on );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void callLog( LogType lt, Class claz, String fmt, Object... args )
|
private static void callLog( LogType lt, Class claz, String fmt,
|
||||||
|
Object... args )
|
||||||
{
|
{
|
||||||
if ( s_doLog ) {
|
if ( s_doLog ) {
|
||||||
String tag = claz.getSimpleName();
|
String tag = claz.getSimpleName();
|
||||||
|
@ -67,26 +68,50 @@ public class DbgUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void logd( String tag, String fmt, Object... args ) {
|
||||||
|
Assert.fail();
|
||||||
|
}
|
||||||
|
|
||||||
public static void logd( Class claz, String fmt, Object... args )
|
public static void logd( Class claz, String fmt, Object... args )
|
||||||
{
|
{
|
||||||
callLog( LogType.DEBUG, claz, fmt, args );
|
callLog( LogType.DEBUG, claz, fmt, args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void loge( String tag, String fmt, Object... args )
|
||||||
|
{
|
||||||
|
Assert.fail();
|
||||||
|
}
|
||||||
|
|
||||||
public static void loge( Class claz, String fmt, Object... args )
|
public static void loge( Class claz, String fmt, Object... args )
|
||||||
{
|
{
|
||||||
callLog( LogType.ERROR, claz, fmt, args );
|
callLog( LogType.ERROR, claz, fmt, args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void logi( String tag, String fmt, Object... args )
|
||||||
|
{
|
||||||
|
Assert.fail();
|
||||||
|
}
|
||||||
|
|
||||||
public static void logi( Class claz, String fmt, Object... args )
|
public static void logi( Class claz, String fmt, Object... args )
|
||||||
{
|
{
|
||||||
logi( claz, true, fmt, args );
|
logi( claz, true, fmt, args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void logi( String tag, boolean persist, String fmt, Object... args )
|
||||||
|
{
|
||||||
|
Assert.fail();
|
||||||
|
}
|
||||||
|
|
||||||
public static void logi( Class claz, boolean persist, String fmt, Object... args )
|
public static void logi( Class claz, boolean persist, String fmt, Object... args )
|
||||||
{
|
{
|
||||||
callLog( LogType.INFO, claz, fmt, args );
|
callLog( LogType.INFO, claz, fmt, args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void logw( String tag, String fmt, Object... args )
|
||||||
|
{
|
||||||
|
Assert.fail();
|
||||||
|
}
|
||||||
|
|
||||||
public static void logw( Class claz, String fmt, Object... args )
|
public static void logw( Class claz, String fmt, Object... args )
|
||||||
{
|
{
|
||||||
callLog( LogType.WARN, claz, fmt, args );
|
callLog( LogType.WARN, claz, fmt, args );
|
||||||
|
|
Loading…
Reference in a new issue