]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - fres/cbroker/fcb.c
Implemented simple logging in FCB
[frescor/frsh.git] / fres / cbroker / fcb.c
index e906ca742c8a59e510a69d1b9c63d35b77b2ceaf..cb9e9a2a578eb283db51881c805ce0a2dbbd649a 100644 (file)
@@ -75,7 +75,7 @@
 #endif
 
 UL_LOG_CUST(ulogd_fcb);
-ul_log_domain_t ulogd_fcb = {UL_LOGL_MSG, "fcb"};
+ul_log_domain_t ulogd_fcb = {UL_LOGL_MSG, "main"};
 UL_LOGREG_SINGLE_DOMAIN_INIT_FUNCTION(init_ulogd_fcb, ulogd_fcb);
        
 fosa_abs_time_t start_time;
@@ -309,8 +309,6 @@ prepare_fcb_contracts(struct fcb *fcb, struct fcb_contract *fcb_contracts[],
        for (i=0; i<num; i++) {
                struct fres_contract *c = contracts[i];
 
-               log_contract("Received contract", i, c);
-               
                if (fres_contract_id_is_empty(&c->id)) {
                        /* Normal negotiation request */
                        forb_uuid_generate((forb_uuid_t *)&c->id);
@@ -321,6 +319,7 @@ prepare_fcb_contracts(struct fcb *fcb, struct fcb_contract *fcb_contracts[],
                        if (!get_res_key(c, &key)) {
                                return FRSH_ERR_RESOURCE_ID_INVALID;
                        }
+                       log_contract("Negotiation request", i, c);
                } else {
                        fc = fcb_contract_find(fcb, &c->id);
                        if (!fc) {
@@ -333,11 +332,13 @@ prepare_fcb_contracts(struct fcb *fcb, struct fcb_contract *fcb_contracts[],
                                if (fres_contract_get_num_blocks(c) == 0) {
                                        /* Cancelation */
                                        get_res_key(fc->user_contract, &key);
+                                       log_contract("Cancelation request", i, fc->user_contract);
                                } else {
                                        /* Renegotiation */
                                        if (!get_res_key(c, &key)) {
                                                return FRSH_ERR_RESOURCE_ID_INVALID;
                                        }
+                                       log_contract("Renegotiation request", i, fc->user_contract);
                                }
                        }
                }