File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change 78
78
enum rwrap_dbglvl_e {
79
79
RWRAP_LOG_ERROR = 0 ,
80
80
RWRAP_LOG_WARN ,
81
+ RWRAP_LOG_NOTICE ,
81
82
RWRAP_LOG_DEBUG ,
82
83
RWRAP_LOG_TRACE
83
84
};
@@ -94,6 +95,7 @@ static void rwrap_log(enum rwrap_dbglvl_e dbglvl,
94
95
const char * d ;
95
96
unsigned int lvl = 0 ;
96
97
int pid = getpid ();
98
+ const char * prefix = NULL ;
97
99
98
100
d = getenv ("RESOLV_WRAPPER_DEBUGLEVEL" );
99
101
if (d != NULL ) {
@@ -110,26 +112,28 @@ static void rwrap_log(enum rwrap_dbglvl_e dbglvl,
110
112
111
113
switch (dbglvl ) {
112
114
case RWRAP_LOG_ERROR :
113
- fprintf (stderr ,
114
- "RWRAP_ERROR(%d) - %s: %s\n" ,
115
- pid , func , buffer );
115
+ prefix = "RWRAP_ERROR" ;
116
116
break ;
117
117
case RWRAP_LOG_WARN :
118
- fprintf (stderr ,
119
- "RWRAP_WARN(%d) - %s: %s\n" ,
120
- pid , func , buffer );
118
+ prefix = "RWRAP_WARN" ;
119
+ break ;
120
+ case RWRAP_LOG_NOTICE :
121
+ prefix = "RWRAP_NOTICE" ;
121
122
break ;
122
123
case RWRAP_LOG_DEBUG :
123
- fprintf (stderr ,
124
- "RWRAP_DEBUG(%d) - %s: %s\n" ,
125
- pid , func , buffer );
124
+ prefix = "RWRAP_DEBUG" ;
126
125
break ;
127
126
case RWRAP_LOG_TRACE :
128
- fprintf (stderr ,
129
- "RWRAP_TRACE(%d) - %s: %s\n" ,
130
- pid , func , buffer );
127
+ prefix = "RWRAP_TRACE" ;
131
128
break ;
132
129
}
130
+
131
+ fprintf (stderr ,
132
+ "%s(%d) - %s: %s\n" ,
133
+ prefix ,
134
+ pid ,
135
+ func ,
136
+ buffer );
133
137
}
134
138
135
139
#ifndef SAFE_FREE
You can’t perform that action at this time.
0 commit comments