X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-export.c;h=fb1888edb31d01db45ce9b1c5fb241d4b6aa4fac;hb=dfe85ca516c207eadc4ae77066c6706f17068f20;hp=e679b769fd59d4064fbe14d808f1e1b1516a66e6;hpb=57a4177d8d0f5c0bbc88f18a4d593f7cf2c8ba55;p=src%2Fapp-framework-binder.git diff --git a/src/afb-export.c b/src/afb-export.c index e679b769..fb1888ed 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -274,7 +274,7 @@ static void vverbose_cb(struct afb_api_x3 *closure, int level, const char *file, if (!fmt || vasprintf(&p, fmt, args) < 0) vverbose(level, file, line, function, fmt, args); else { - verbose(level, file, line, function, "[API %s] %s", export->api.apiname, p); + verbose(level, file, line, function, (verbose_is_colorized() == 0 ? "[API %s] %s" : COLOR_API "[API %s]" COLOR_DEFAULT " %s"), export->api.apiname, p); free(p); } } @@ -352,6 +352,11 @@ static int require_api_cb(struct afb_api_x3 *closure, const char *name, int init int rc, rc2; char *iter, *end, save; + /* emit a warning about unexpected require in preinit */ + if (export->state == Api_State_Pre_Init) + WARNING("[API %s] requiring apis in pre-init may lead to unexpected result (requires%s: %s)", + export->api.apiname, initialized ? " initialized" : "", name); + /* scan the names in a local copy */ rc = 0; iter = strdupa(name);