From 584cb1879571c6c62ab014b8725d27168b0c1ad2 Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 17 Apr 2020 23:28:01 +0300 Subject: [PATCH] introduce the ENABLE_LOG macro --- Makefile | 3 ++- docker-compose.yml | 1 + src/wrapper.c | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5875055..54cdb67 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,8 @@ SQLITE_FLAGS = \ -DSQLITE_ENABLE_OFFSET_SQL_FUNC\ -DSQLITE_ENABLE_DESERIALIZE\ -DSQLITE_INTROSPECTION_PRAGMAS\ - -DSQLITE_OMIT_POPEN + -DSQLITE_OMIT_POPEN\ + -DLOG_ENABLED .PHONY: default all clean diff --git a/docker-compose.yml b/docker-compose.yml index db4b53e..a3bb07d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,5 +3,6 @@ services: sqlite3: build: context: . + container_name: sqlite3_builder volumes: - .:/code diff --git a/src/wrapper.c b/src/wrapper.c index 41f233e..7657f47 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -110,14 +110,20 @@ const char *invoke(char *request, int request_size) { if(g_isInited == 0) { // TODO: check the return code init(); + +#if LOG_ENABLED const char successInitMessage[] = "Sqlite has been initialized"; log_utf8_string(successInitMessage, sizeof(successInitMessage)); +#endif + g_isInited = 1; } request[request_size] = 0; +#if LOG_ENABLED log_utf8_string(request, request_size); +#endif ShellText str; initText(&str);