Android Studioc print + view log

Table of contents

Logcat writes logs

View application logs


Logcat writes logs

View application logs

To display log messages for your application:

  1. Build and run the app on the device .
  2. Click  View > Tool Windows > Logcat , or click the Logcat icon in the tool window bar   .

The Logcat window displays log messages for the application selected from the menu at the top of the window, as shown.

By default, Logcat only displays log messages for apps running on the device. To change this default setting, see How to Filter Logcat Messages .

The following buttons are available in the Logcat toolbar:

  1. Clear Logcat  : Click this button to clear the displayed log.
  2. Scroll to the end  : Click this button to jump to the bottom of the log and view the latest log messages. If you click this button and then click a row in the log, the view will pause scrolling at that location.
  3. Up the stack trace   and  Down the stack trace  : Click the corresponding buttons to navigate up and down in the stack trace of the log to select the previous or next file name displayed in the output exception. This is the same behavior as when you click on a file name in the log.
  4. Use soft wraps  : Click this button to enable line wrapping and prevent horizontal scrolling. However, all non-interrupted strings still require horizontal scrolling.
  5. Print  : Click this button to output Logcat messages. After selecting your output preferences in the dialog box that appears, you can also choose to save the message in PDF format.
  6. Restart  : Click this button to clear the log and restart Logcat. Unlike  the Clear Logcat  button, this button restores and displays previous log messages, so it is most useful when Logcat becomes unresponsive and you do not want to lose log messages.
  7. Logcat header  : Click this button to open  the Configure Logcat Header  dialog box, in which you can customize the appearance of individual Logcat messages, such as whether to display the date and time.
  8. Screen capture  : Click this button to take a screenshot .
  9. Screen record  : Click this button to record a video of the device screen (no more than 3 minutes in duration).

Supongo que te gusta

Origin blog.csdn.net/qq_53679247/article/details/132945434
Recomendado
Clasificación