]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - fres/cbroker/contract_log.c
f391b6deb47a258c84f669c330f9895afcdc79d0
[frescor/frsh.git] / fres / cbroker / contract_log.c
1 /**
2  * @file   contract_log.c
3  * @author Michal Sojka <sojkam1@fel.cvut.cz>
4  * @date   Mon Aug 10 13:00:20 2009
5  * 
6  * @brief  
7  * 
8  * 
9  */
10
11 #include <ul_log.h>
12 #include "contract_log.h"
13 #include <ul_logreg.h>
14
15 static UL_LOG_CUST(ulogd);
16 static ul_log_domain_t ulogd = {UL_LOGL_MSG, "fcb_contract_log"};
17 UL_LOGREG_SINGLE_DOMAIN_INIT_FUNCTION(init_ulogd_contract_log, ulogd);
18
19 void
20 log_contract(const char *prefix, int index, const struct fres_contract *c)
21 {
22         if (ul_log_cond(&ulogd, UL_LOGL_DEB)) {
23                 /* Dump contract contract */
24                 char str[1000];
25                 fres_contract_to_string2(str, sizeof(str), c, 4, 0);
26                 ul_logdeb("%s #%d:\n%s", prefix, index, str);
27 }
28 }