File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime/logging Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 18
18
import android .util .Log ;
19
19
20
20
public final class Logging {
21
+ private static final String prefix = "TRuntime." ;
21
22
private Logging () {}
22
23
23
24
private static String getTag (String tag ) {
24
- String prefix = "TRuntime." ;
25
- return prefix + concatTag (prefix , tag );
25
+ if (android .os .Build .VERSION .SDK_INT < Build .VERSION_CODES .N )
26
+ return concatTag (prefix , tag );
27
+
28
+ return prefix + tag ;
26
29
}
27
30
28
31
private static String concatTag (String prefix , String tag ){
32
+ String concatText = prefix + tag ;
29
33
int loggableLimit = 23 ;
30
- int remainingSpace = loggableLimit - prefix .length ();
31
34
32
- if (android .os .Build .VERSION .SDK_INT < Build .VERSION_CODES .N )
33
- if (tag .length () > remainingSpace )
34
- tag = tag .substring (0 , remainingSpace );
35
+ if (concatText .length () > loggableLimit )
36
+ concatText = concatText .substring (0 , loggableLimit );
35
37
36
- return tag ;
38
+ return concatText ;
37
39
}
38
40
39
41
public static void d (String tag , String message ) {
You can’t perform that action at this time.
0 commit comments