Reputation: 2993
Want to Log something with Log.d, but no output text is appearing in the Android Monitor section. Code is like below?
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
insertToDb();
}
private void insertToDb() {
Log.d("TAG", "Rows count: ");
}
After restarting nothing changed also:
Upvotes: 0
Views: 6372
Reputation: 1
I had this problem as well. At first, I was importing Log using this:
import com.example.android.common.logger.Log;
When I imported Log using this:
import android.util.Log;
the output appeared.
Upvotes: 0
Reputation: 586
This might help
Huawei, logcat not showing the log for my app?
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
You might have to enable both AP and CP logs for debug and verbose logs to show.
PS : probably only for Huawei devices.
Upvotes: 10
Reputation: 451
Use
Log.e("TAG", "Rows count: ");
For the log to be in red (error) for better visibility.Remember to clear the search bar of the logs pane to display all logs too
Upvotes: 1
Reputation: 986
Its working fine... you need to check log under Debug section as you have used Log.d.
Upvotes: -2
Reputation: 44
It is working. i had tried. but if it is not working in your android studio then check you had selected your device properly or else try to restart the android studio.
Upvotes: 0