1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.bugreport.logcat;
18 
19 import com.android.bugreport.bugreport.ProcessInfo;
20 import com.android.bugreport.bugreport.ThreadInfo;
21 import com.android.bugreport.util.Line;
22 
23 import java.util.ArrayList;
24 import java.util.GregorianCalendar;
25 
26 /**
27  * A log line.
28  */
29 public class LogLine extends Line {
30 
31     /**
32      * The raw text of the log.
33      */
34     public String rawText;
35 
36     /**
37      * If this is set, this line is the beginning of a log buffer. All the following
38      * fields will be null / unset.
39      */
40     public String bufferBegin;
41 
42     /**
43      * The raw text of everything up to the tag.
44      */
45     public String header;
46 
47     /**
48      * The timestamp of the event. In UTC even though the device might not have been.
49      */
50     public GregorianCalendar time;
51 
52     /**
53      * The process that emitted the log.
54      */
55     public int pid = -1;
56 
57     /**
58      * The thread that emitted the log.
59      */
60     public int tid = -1;
61 
62     /**
63      * The log level. One of EWIDV.
64      */
65     public char level;
66 
67     /**
68      * The log tag.
69      */
70     public String tag;
71 
72     /**
73      * If this log was taken during the period when the app was unresponsive
74      * preceeding an anr.
75      */
76     public boolean regionAnr;
77 
78     /**
79      * If a bugreport was being taken during this log line
80      */
81     public boolean regionBugreport;
82 
83     /**
84      * The process associated with this log line.
85      *
86      * TODO: Use the full list of processes from all sources, not just the one from the ANR.
87      */
88     public ProcessInfo process;
89 
90     /**
91      * The thread associated with this log line.
92      *
93      * TODO: Use the full list of processes from all sources, not just the one from the ANR.
94      */
95     public ThreadInfo thread;
96 }
97 
98