add debug_color sync
authorVolker Birk <vb@pep-project.org>
Fri, 25 Oct 2019 11:45:28 +0200
branchsync
changeset 41347d55c23d5bd4
parent 4133 ff662df0bb63
child 4137 ada10e418714
child 4138 732087dd8aa5
add debug_color
src/pEpEngine.c
src/pEpEngine.h
src/pEp_internal.h
     1.1 --- a/src/pEpEngine.c	Fri Oct 25 11:08:38 2019 +0200
     1.2 +++ b/src/pEpEngine.c	Fri Oct 25 11:45:28 2019 +0200
     1.3 @@ -5367,3 +5367,11 @@
     1.4  #endif
     1.5      log_service(session, "### service error log ###", entity, buffer, where);
     1.6  }
     1.7 +
     1.8 +#ifndef NDEBUG
     1.9 +DYNAMIC_API void set_debug_color(PEP_SESSION session, int ansi_color)
    1.10 +{
    1.11 +    session->debug_color = ansi_color;
    1.12 +}
    1.13 +#endif
    1.14 +
     2.1 --- a/src/pEpEngine.h	Fri Oct 25 11:08:38 2019 +0200
     2.2 +++ b/src/pEpEngine.h	Fri Oct 25 11:45:28 2019 +0200
     2.3 @@ -406,6 +406,10 @@
     2.4      );
     2.5  
     2.6  
     2.7 +#ifndef NDEBUG
     2.8 +DYNAMIC_API void set_debug_color(PEP_SESSION session, int ansi_color);
     2.9 +#endif
    2.10 +
    2.11  // log_event() - log a user defined event defined by UTF-8 encoded strings into
    2.12  // management log
    2.13  //
     3.1 --- a/src/pEp_internal.h	Fri Oct 25 11:08:38 2019 +0200
     3.2 +++ b/src/pEp_internal.h	Fri Oct 25 11:45:28 2019 +0200
     3.3 @@ -277,8 +277,11 @@
     3.4      bool unencrypted_subject;
     3.5      bool service_log;
     3.6      
     3.7 -#ifdef DEBUG_ERRORSTACK
     3.8 +#ifndef NDEBUG
     3.9 +#   ifdef DEBUG_ERRORSTACK
    3.10      stringlist_t* errorstack;
    3.11 +#   endif
    3.12 +    int debug_color;
    3.13  #endif
    3.14  };
    3.15  
    3.16 @@ -567,3 +570,4 @@
    3.17      } while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
    3.18      return rc;
    3.19  }
    3.20 +