Skip to content

Commit

Permalink
Print app name when SEAFILE_LOG_TO_STDOUT is true (#734)
Browse files Browse the repository at this point in the history
Co-authored-by: 杨赫然 <[email protected]>
  • Loading branch information
feiniks and 杨赫然 authored Jan 13, 2025
1 parent e2d7718 commit e225c23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ seafile_log_init (const char *_logfile, const char *ccnet_debug_level_str,
app_name = g_strdup (_app_name);

const char *log_to_stdout_env = g_getenv("SEAFILE_LOG_TO_STDOUT");
if (g_strcmp0(_logfile, "-") == 0 || g_strcmp0(log_to_stdout_env, "true") == 0) {
if (g_strcmp0(log_to_stdout_env, "true") == 0) {
logfp = stdout;
logfile = g_strdup (_logfile);
log_to_stdout = TRUE;
}
else {
} else if (g_strcmp0(_logfile, "-") == 0) {
logfp = stdout;
logfile = g_strdup (_logfile);
} else {
logfile = ccnet_expand_path(_logfile);
if ((logfp = g_fopen (logfile, "a+")) == NULL) {
seaf_message ("Failed to open file %s\n", logfile);
Expand Down

0 comments on commit e225c23

Please sign in to comment.