Overview
Comment: | Improve debug logging flexibility |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | e722919c08c82bb11e41b519411c4d02a9e22ac6 |
User & Date: | rkeene on 2020-05-12 15:09:18 |
Other Links: | manifest | tags |
Context
2020-05-12
| ||
15:09 | AppFS 1.14 check-in: 567832addb user: rkeene tags: trunk, 1.14 | |
15:09 | Improve debug logging flexibility check-in: e722919c08 user: rkeene tags: trunk | |
15:08 | Commit [7241c0986c] broke writing because error messages were checked, fix the check and fix writing check-in: b5b196f3f3 user: rkeene tags: trunk | |
Changes
Modified Makefile from [bc18beb7d4] to [27f21bab36].
1 2 3 4 5 6 7 8 9 10 11 12 |
APPFS_VERSION = 1.12 CC = gcc PKG_CONFIG = pkg-config FUSE_CFLAGS = $(shell $(PKG_CONFIG) --cflags fuse) CFLAGS_DEBUG = -Wall -g3 -ggdb3 -DDEBUG=1 -UNDEBUG -O0 -DAPPFS_EXIT_PATH=1 CFLAGS_RELEASE = -Wall -UDEBUG -DNDEBUG=1 -O3 ifneq ($(APPFS_DEBUG_BUILD),1) CFLAGS += $(FUSE_CFLAGS) $(TCL_CFLAGS) $(CFLAGS_RELEASE) else CFLAGS += $(FUSE_CFLAGS) $(TCL_CFLAGS) $(CFLAGS_DEBUG) endif LDFLAGS += $(TCL_LDFLAGS) |
| |
1 2 3 4 5 6 7 8 9 10 11 12 |
APPFS_VERSION = 1.12
CC = gcc
PKG_CONFIG = pkg-config
FUSE_CFLAGS = $(shell $(PKG_CONFIG) --cflags fuse)
CFLAGS_DEBUG = -Wall -g3 -ggdb3 -DDEBUG=1 -UNDEBUG -O0 -DAPPFS_EXIT_PATH=1 -DAPPFS_DEBUG_FD=stderr
CFLAGS_RELEASE = -Wall -UDEBUG -DNDEBUG=1 -O3
ifneq ($(APPFS_DEBUG_BUILD),1)
CFLAGS += $(FUSE_CFLAGS) $(TCL_CFLAGS) $(CFLAGS_RELEASE)
else
CFLAGS += $(FUSE_CFLAGS) $(TCL_CFLAGS) $(CFLAGS_DEBUG)
endif
LDFLAGS += $(TCL_LDFLAGS)
|
Modified appfsd.c from [0494c72e1d] to [b81dc3008d].
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
....
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
|
#ifndef APPFS_CACHEDIR #define APPFS_CACHEDIR "/var/cache/appfs" #endif /* Debugging macros */ #ifdef DEBUG FILE *appfs_debug_fd = NULL; #define APPFS_DEBUG(x...) { \ char buf[8192]; \ int bufoff = 0; \ if (appfs_debug_fd == NULL) { \ appfs_debug_fd = fopen("/tmp/appfsd.log", "a"); \ }; \ if (appfs_debug_fd == NULL) { appfs_debug_fd = stderr; } \ bufoff = snprintf(buf, sizeof(buf), "[debug] [t=%llx] %s:%i:%s: ", (unsigned long long) pthread_self(), __FILE__, __LINE__, __func__); \ if (bufoff < sizeof(buf)) { \ bufoff += snprintf(buf + bufoff, sizeof(buf) - bufoff, x); \ }; \ if (bufoff < sizeof(buf)) { \ ................................................................................ /* * Skip passed program name */ if (argc == 0 || argv == NULL) { return(1); } argv0 = argv[0]; argc--; argv++; /* |
>
>
>
>
>
>
>
>
>
|
>
>
>
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
....
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
|
#ifndef APPFS_CACHEDIR #define APPFS_CACHEDIR "/var/cache/appfs" #endif /* Debugging macros */ #ifdef DEBUG FILE *appfs_debug_fd = NULL; #ifndef APPFS_DEBUG_FD # ifdef APPFS_DEBUG_FILE # define APPFS_DEBUG_FD fopen(APPFS_DEBUG_FILE, "a") # else # define APPFS_DEBUG_FD fopen("/tmp/appfsd.log", "a") # endif #endif #define APPFS_DEBUG(x...) { \ char buf[8192]; \ int bufoff = 0; \ if (appfs_debug_fd == NULL) { \ appfs_debug_fd = APPFS_DEBUG_FD; \ }; \ if (appfs_debug_fd == NULL) { appfs_debug_fd = stderr; } \ bufoff = snprintf(buf, sizeof(buf), "[debug] [t=%llx] %s:%i:%s: ", (unsigned long long) pthread_self(), __FILE__, __LINE__, __func__); \ if (bufoff < sizeof(buf)) { \ bufoff += snprintf(buf + bufoff, sizeof(buf) - bufoff, x); \ }; \ if (bufoff < sizeof(buf)) { \ ................................................................................ /* * Skip passed program name */ if (argc == 0 || argv == NULL) { return(1); } for (i = 0; i < argc; i++) { // printf("argv[%i] = \"%s\"\n", i, argv[i]); } argv0 = argv[0]; argc--; argv++; /* |