2012-02-02 49 views
2

如何转换在Android或Java中使用此代码,因为它是用Objective C编写的?Alog转换为Java

ALog(@"ERROR: Account with UserId:%@ AccountType:%d AccoundId:%d DOES NOT EXIST!", 
    account.userId, account.accountType, account.accountId); 
+0

会的Log4j是答案的一部分吗? – 2012-02-02 07:08:28

+0

也许。 http://code.google.com/p/android-logging-log4j/ – dbrank0 2012-02-02 07:11:16

回答

0

嗯,Android版”我想要做的事情如下:

Log.i("AccountActivity", "Account with UserId: " + userId + 
     " AccountType: " + accountType + 
     " AccountId: " + accountId + 
     " Does not exist."); 

这将出现在由活动和级别(本例中为info)格式化的logcat中。可能是这样的:

I/AccountActivity(1234): Account with UserId: {id} AccountType: {type} AccountId: {id} Does not exist. 

不知道这是否回答你的问题......到这里看看,寻求更多帮助:http://developer.android.com/guide/developing/debugging/debugging-log.html