Optimize NsdManager logging to reduce noise
Only log NsdManager receive packet processing when DBG is true. Move packet sending logs from ShareLog to Log.i(). This change reduces the verbosity of ShareLog, allowing it to focus primarily on critical information such as advertising registration. Flag: EXEMPT logging only change Test: TH Change-Id: I6b73c42698d8ccfe5fe880c1509bdefdceb0973a
This commit is contained in:
parent
1d37c4ce68
commit
8d25c78ad2
2 changed files with 4 additions and 2 deletions
|
|
@ -443,7 +443,7 @@ public class MdnsInterfaceAdvertiser implements MulticastPacketReader.PacketHand
|
|||
// conflicting service is still probing and won't reply either.
|
||||
final MdnsReplyInfo answers = mRecordRepository.getReply(packet, srcCopy);
|
||||
// Dump the query packet.
|
||||
if (DBG || answers != null) {
|
||||
if (DBG && answers != null) {
|
||||
mSharedLog.v("Parsed packet with transactionId(" + packet.transactionId + "): "
|
||||
+ packet.questions.size() + " questions, "
|
||||
+ packet.answers.size() + " answers, "
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import android.os.Looper;
|
|||
import android.os.Message;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.net.module.util.SharedLog;
|
||||
|
|
@ -55,6 +56,7 @@ import java.util.Set;
|
|||
public class MdnsReplySender {
|
||||
@VisibleForTesting
|
||||
static final int MSG_SEND = 1;
|
||||
private static final String TAG = MdnsReplySender.class.getSimpleName();
|
||||
private static final int PACKET_NOT_SENT = 0;
|
||||
private static final int PACKET_SENT = 1;
|
||||
|
||||
|
|
@ -282,7 +284,7 @@ public class MdnsReplySender {
|
|||
return;
|
||||
}
|
||||
|
||||
mSharedLog.log("Sending " + replyInfo);
|
||||
Log.i(TAG, "Sending " + replyInfo);
|
||||
|
||||
final int flags = 0x8400; // Response, authoritative (rfc6762 18.4)
|
||||
final MdnsPacket packet = new MdnsPacket(flags,
|
||||
|
|
|
|||
Loading…
Reference in a new issue