Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print app name when SEAFILE_LOG_TO_STDOUT is true #734

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading