Merge branch 'logging_changes' of https://github.com/adam-bishop/trust_router
authorSam Hartman <hartmans@debian.org>
Wed, 11 Mar 2015 17:31:36 +0000 (13:31 -0400)
committerSam Hartman <hartmans@debian.org>
Wed, 11 Mar 2015 17:31:36 +0000 (13:31 -0400)
Pull in two additional fixes from Adam.

common/tr_debug.c
tid/example/tidc_main.c
tid/example/tids_main.c
tr/tr_main.c

index 874b595..6f4fc6e 100644 (file)
@@ -231,8 +231,6 @@ void tr_log_close() {
 
 void tr_log(const int sev, const char *fmt, ...) {
 
-  tr_log_open();
-
   if (NULL != fmt) {
 
     va_list ap;
@@ -252,8 +250,6 @@ void tr_log(const int sev, const char *fmt, ...) {
 
 void tr_audit_resp(TID_RESP *resp) {
 
-  tr_log_open();
-
   if (NULL != resp) {
 
     char *attrs[] = { audit_fmt("result", resp->result ? "error" : "success"),
@@ -278,8 +274,6 @@ void tr_audit_resp(TID_RESP *resp) {
 
 void tr_audit_req(TID_REQ *req) {
 
-  tr_log_open();
-
   if (NULL != req) {
 
     char *attrs[] = { audit_fmt("comm", NULL != req->comm ? req->comm->buf : NULL),
index 9f27018..7050eb8 100644 (file)
@@ -99,6 +99,9 @@ int main (int argc,
   int rc;
   gss_ctx_id_t gssctx;
 
+  /* Use standalone logging */
+  tr_log_open();
+
   /* set logging levels */
   talloc_set_log_stderr();
   tr_log_threshold(LOG_CRIT);
index 313e457..ce434ae 100644 (file)
@@ -279,6 +279,9 @@ int main (int argc,
     exit(1);
   }
 
+  /* Use standalone logging */
+  tr_log_open();
+
   /* set logging levels */
   tr_log_threshold(LOG_CRIT);
   tr_console_threshold(LOG_DEBUG);
index ae662fa..dc18ca0 100644 (file)
@@ -259,6 +259,9 @@ int main (int argc, const char *argv[])
 
   /* parse command-line arguments? -- TBD */
 
+  /* Use standalone logging */
+  tr_log_open();
+
   /* create a Trust Router instance */
   if (NULL == (tr = tr_create())) {
     tr_crit("Unable to create Trust Router instance, exiting.");