Source
12
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
** GNU General Public License for more details.
14
14
**
15
15
** You should have received a copy of the GNU General Public License
16
16
** along with this program; if not, write to the Free Software
17
17
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
18
**/
19
19
20
20
#include "zbxcommon.h"
21
21
22
-
/* make sure that __wrap_*() prototypes match unwrapped counterparts */
23
-
#define __zbx_zabbix_log __wrap___zbx_zabbix_log
24
-
#include "log.h"
25
-
#undef __zbx_zabbix_log
26
-
27
-
void __wrap___zbx_zabbix_log(int level, const char *fmt, ...)
22
+
void zbx_mock_log_impl(int level, const char *fmt, va_list args)
28
23
{
29
-
va_list args;
30
-
31
24
fprintf(stdout, "[ LOG (");
32
25
33
26
switch (level)
34
27
{
35
28
case LOG_LEVEL_CRIT:
36
29
fprintf(stdout, "CR");
37
30
break;
38
31
case LOG_LEVEL_ERR:
39
32
fprintf(stdout, "ER");
40
33
break;
50
43
case LOG_LEVEL_INFORMATION:
51
44
fprintf(stdout, "IN");
52
45
break;
53
46
default:
54
47
fprintf(stdout, "NA");
55
48
break;
56
49
}
57
50
58
51
fprintf(stdout, ") ] ");
59
52
60
-
va_start(args, fmt);
61
53
vfprintf(stdout, fmt, args);
62
-
va_end(args);
63
54
64
55
fprintf(stdout, "\n");
65
56
fflush(stdout);
66
57
}