Commit 3a38b054 authored by Ophélie Gagnard's avatar Ophélie Gagnard

src: Switch log file to append mode

Append to the end of the log file instead of overriding it altogether.
parent a26afc92
...@@ -6453,7 +6453,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p ...@@ -6453,7 +6453,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* node = consume active_node * node = consume active_node
* *
* realpath(log_path, resolved_log_path) # <<<<<<<<<<<<<< * realpath(log_path, resolved_log_path) # <<<<<<<<<<<<<<
* result = fopen(resolved_log_path, 'w') * result = fopen(resolved_log_path, 'a')
* if result is NULL: * if result is NULL:
*/ */
(void)(realpath(__pyx_v_log_path, __pyx_v_resolved_log_path)); (void)(realpath(__pyx_v_log_path, __pyx_v_resolved_log_path));
...@@ -6461,15 +6461,15 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p ...@@ -6461,15 +6461,15 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
/* "main.pyx":294 /* "main.pyx":294
* *
* realpath(log_path, resolved_log_path) * realpath(log_path, resolved_log_path)
* result = fopen(resolved_log_path, 'w') # <<<<<<<<<<<<<< * result = fopen(resolved_log_path, 'a') # <<<<<<<<<<<<<<
* if result is NULL: * if result is NULL:
* fprintf(stderr, 'Error creating the log file.\n') * fprintf(stderr, 'Error creating the log file.\n')
*/ */
__pyx_v_result = fopen(__pyx_v_resolved_log_path, ((char const *)"w")); __pyx_v_result = fopen(__pyx_v_resolved_log_path, ((char const *)"a"));
/* "main.pyx":295 /* "main.pyx":295
* realpath(log_path, resolved_log_path) * realpath(log_path, resolved_log_path)
* result = fopen(resolved_log_path, 'w') * result = fopen(resolved_log_path, 'a')
* if result is NULL: # <<<<<<<<<<<<<< * if result is NULL: # <<<<<<<<<<<<<<
* fprintf(stderr, 'Error creating the log file.\n') * fprintf(stderr, 'Error creating the log file.\n')
* fflush(stderr) * fflush(stderr)
...@@ -6478,7 +6478,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p ...@@ -6478,7 +6478,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
if (__pyx_t_8) { if (__pyx_t_8) {
/* "main.pyx":296 /* "main.pyx":296
* result = fopen(resolved_log_path, 'w') * result = fopen(resolved_log_path, 'a')
* if result is NULL: * if result is NULL:
* fprintf(stderr, 'Error creating the log file.\n') # <<<<<<<<<<<<<< * fprintf(stderr, 'Error creating the log file.\n') # <<<<<<<<<<<<<<
* fflush(stderr) * fflush(stderr)
...@@ -6507,7 +6507,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p ...@@ -6507,7 +6507,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
/* "main.pyx":295 /* "main.pyx":295
* realpath(log_path, resolved_log_path) * realpath(log_path, resolved_log_path)
* result = fopen(resolved_log_path, 'w') * result = fopen(resolved_log_path, 'a')
* if result is NULL: # <<<<<<<<<<<<<< * if result is NULL: # <<<<<<<<<<<<<<
* fprintf(stderr, 'Error creating the log file.\n') * fprintf(stderr, 'Error creating the log file.\n')
* fflush(stderr) * fflush(stderr)
......
...@@ -291,7 +291,7 @@ cdef int start(const char *path_to_scan, const char *log_path) nogil: ...@@ -291,7 +291,7 @@ cdef int start(const char *path_to_scan, const char *log_path) nogil:
node = consume active_node node = consume active_node
realpath(log_path, resolved_log_path) realpath(log_path, resolved_log_path)
result = fopen(resolved_log_path, 'w') result = fopen(resolved_log_path, 'a')
if result is NULL: if result is NULL:
fprintf(stderr, 'Error creating the log file.\n') fprintf(stderr, 'Error creating the log file.\n')
fflush(stderr) fflush(stderr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment