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