@@ -69,13 +69,9 @@ func TestParseComponentLogLevel(t *testing.T) {
6969 },
7070 },
7171 {
72- name : "mixed-case level names are treated as unknown and default to FATAL " ,
72+ name : "mixed-case level names are treated as unknown and skipped " ,
7373 input : "dns:Error,xds:Warning,authz:Info" ,
74- want : map [string ]severityLevel {
75- "dns" : severityFatal ,
76- "xds" : severityFatal ,
77- "authz" : severityFatal ,
78- },
74+ want : map [string ]severityLevel {},
7975 },
8076 {
8177 name : "parses multiple comma-separated components with different levels" ,
@@ -102,10 +98,9 @@ func TestParseComponentLogLevel(t *testing.T) {
10298 },
10399 },
104100 {
105- name : "unrecognized level name defaults to FATAL " ,
101+ name : "unrecognized level name is skipped " ,
106102 input : "dns:UNKNOWN,xds:ERROR" ,
107103 want : map [string ]severityLevel {
108- "dns" : severityFatal ,
109104 "xds" : severityError ,
110105 },
111106 },
@@ -220,11 +215,14 @@ func TestLogger(t *testing.T) {
220215 },
221216 },
222217 {
223- name : "FATAL GRPC_GO_COMPONENT_LOG_LEVEL suppresses all non-fatal logs " ,
218+ name : "unrecognized GRPC_GO_COMPONENT_LOG_LEVEL falls back to global default " ,
224219 componentLogLevel : "dns:FATAL" ,
225220 logSeverityLevel : "INFO" ,
226221 components : []string {"dns" , "balancer" },
227222 want : []string {
223+ "INFO: [dns] dns-info" ,
224+ "WARNING: [dns] dns-warning" ,
225+ "ERROR: [dns] dns-error" ,
228226 "INFO: [balancer] balancer-info" ,
229227 "WARNING: [balancer] balancer-warning" ,
230228 "ERROR: [balancer] balancer-error" ,
0 commit comments