1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-19 01:17:26 +00:00

Log format (#704)

* Format c log

* Format go log

* Add SEAFILE_LOG_TO_STDOUT env

* Modify parameters name

* Set stdout to output

* Add app name and print error log

* Disable daemon mode when SEAFILE_LOG_TO_STDOUT is true

---------

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks
2024-10-24 10:46:41 +08:00
committed by GitHub
parent 1afed5d770
commit 6af96fe1d2
8 changed files with 109 additions and 45 deletions

View File

@@ -30,9 +30,8 @@ static const struct option long_opts[] = {
static void usage ()
{
fprintf (stderr,
"usage: seaf-fsck [-r] [-E exported_path] [-c config_dir] [-d seafile_dir] "
"[repo_id_1 [repo_id_2 ...]]\n");
fprintf (stderr, "usage: seaf-fsck [-r] [-E exported_path] [-c config_dir] [-d seafile_dir] "
"[repo_id_1 [repo_id_2 ...]]\n");
}
#ifdef WIN32
@@ -141,8 +140,8 @@ main(int argc, char *argv[])
g_type_init();
#endif
if (seafile_log_init ("-", "info", "debug") < 0) {
seaf_warning ("Failed to init log.\n");
if (seafile_log_init ("-", "info", "debug", "seaf-fsck") < 0) {
fprintf (stderr, "Failed to init log.\n");
exit (1);
}

View File

@@ -31,14 +31,13 @@ static const struct option long_opts[] = {
static void usage ()
{
fprintf (stderr,
"usage: seafserv-gc [-c config_dir] [-d seafile_dir] "
"[repo_id_1 [repo_id_2 ...]]\n"
"Additional options:\n"
"-r, --rm-deleted: remove garbaged repos\n"
"-R, --rm-fs: remove fs object\n"
"-D, --dry-run: report blocks that can be remove, but not remove them\n"
"-V, --verbose: verbose output messages\n");
fprintf (stderr, "usage: seafserv-gc [-c config_dir] [-d seafile_dir] "
"[repo_id_1 [repo_id_2 ...]]\n"
"Additional options:\n"
"-r, --rm-deleted: remove garbaged repos\n"
"-R, --rm-fs: remove fs object\n"
"-D, --dry-run: report blocks that can be remove, but not remove them\n"
"-V, --verbose: verbose output messages\n");
}
#ifdef WIN32
@@ -122,8 +121,8 @@ main(int argc, char *argv[])
g_type_init();
#endif
if (seafile_log_init ("-", "info", "debug") < 0) {
seaf_warning ("Failed to init log.\n");
if (seafile_log_init ("-", "info", "debug", "seafserv-gc") < 0) {
fprintf (stderr, "Failed to init log.\n");
exit (1);
}