mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 09:13:14 +02:00
Renamed WeeChat log functions
This commit is contained in:
@@ -59,7 +59,7 @@ weechat_backtrace_printf (char *message, ...)
|
||||
va_end (argptr);
|
||||
|
||||
string_iconv_fprintf (stderr, "%s", buffer);
|
||||
weechat_log_printf ("%s", buffer);
|
||||
log_printf ("%s", buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -455,8 +455,8 @@ config_file_write_default (char **config_sections, struct t_config_option **opti
|
||||
_("%s: creating default config file \"%s\"...\n"),
|
||||
PACKAGE_NAME,
|
||||
config_filename);
|
||||
weechat_log_printf (_("Creating default config file \"%s\"\n"),
|
||||
config_filename);
|
||||
log_printf (_("Creating default config file \"%s\"\n"),
|
||||
config_filename);
|
||||
|
||||
config_file_write_header (file);
|
||||
|
||||
|
||||
@@ -1228,7 +1228,7 @@ weechat_config_write_keys_default_values (FILE *file, char *section_name,
|
||||
int
|
||||
weechat_config_write ()
|
||||
{
|
||||
weechat_log_printf (_("Saving WeeChat configuration to disk\n"));
|
||||
log_printf (_("Saving WeeChat configuration to disk\n"));
|
||||
return config_file_write (weechat_config_sections, weechat_config_options,
|
||||
weechat_config_write_functions,
|
||||
WEECHAT_CONFIG_NAME);
|
||||
|
||||
+29
-29
@@ -752,49 +752,49 @@ hook_print_log ()
|
||||
for (ptr_hook = weechat_hooks; ptr_hook;
|
||||
ptr_hook = ptr_hook->next_hook)
|
||||
{
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf ("[hook (addr:0x%X)]\n", ptr_hook);
|
||||
weechat_log_printf (" type . . . . . . . . . : %d\n", ptr_hook->type);
|
||||
weechat_log_printf (" callback_data. . . . . : 0x%X\n", ptr_hook->callback_data);
|
||||
log_printf ("\n");
|
||||
log_printf ("[hook (addr:0x%X)]\n", ptr_hook);
|
||||
log_printf (" type . . . . . . . . . : %d\n", ptr_hook->type);
|
||||
log_printf (" callback_data. . . . . : 0x%X\n", ptr_hook->callback_data);
|
||||
switch (ptr_hook->type)
|
||||
{
|
||||
case HOOK_TYPE_COMMAND:
|
||||
weechat_log_printf (" command data:\n");
|
||||
weechat_log_printf (" callback . . . . . . : 0x%X\n", HOOK_COMMAND(ptr_hook, callback));
|
||||
weechat_log_printf (" command. . . . . . . : '%s'\n", HOOK_COMMAND(ptr_hook, command));
|
||||
weechat_log_printf (" command_desc . . . . : '%s'\n", HOOK_COMMAND(ptr_hook, description));
|
||||
weechat_log_printf (" command_args . . . . : '%s'\n", HOOK_COMMAND(ptr_hook, args));
|
||||
weechat_log_printf (" command_args_desc. . : '%s'\n", HOOK_COMMAND(ptr_hook, args_description));
|
||||
weechat_log_printf (" command_completion . : '%s'\n", HOOK_COMMAND(ptr_hook, completion));
|
||||
log_printf (" command data:\n");
|
||||
log_printf (" callback . . . . . . : 0x%X\n", HOOK_COMMAND(ptr_hook, callback));
|
||||
log_printf (" command. . . . . . . : '%s'\n", HOOK_COMMAND(ptr_hook, command));
|
||||
log_printf (" command_desc . . . . : '%s'\n", HOOK_COMMAND(ptr_hook, description));
|
||||
log_printf (" command_args . . . . : '%s'\n", HOOK_COMMAND(ptr_hook, args));
|
||||
log_printf (" command_args_desc. . : '%s'\n", HOOK_COMMAND(ptr_hook, args_description));
|
||||
log_printf (" command_completion . : '%s'\n", HOOK_COMMAND(ptr_hook, completion));
|
||||
break;
|
||||
case HOOK_TYPE_TIMER:
|
||||
weechat_log_printf (" timer data:\n");
|
||||
weechat_log_printf (" interval . . . . . . : %ld\n", HOOK_TIMER(ptr_hook, interval));
|
||||
weechat_log_printf (" last_exec.tv_sec . . : %ld\n", HOOK_TIMER(ptr_hook, last_exec.tv_sec));
|
||||
weechat_log_printf (" last_exec.tv_usec. . : %ld\n", HOOK_TIMER(ptr_hook, last_exec.tv_usec));
|
||||
log_printf (" timer data:\n");
|
||||
log_printf (" interval . . . . . . : %ld\n", HOOK_TIMER(ptr_hook, interval));
|
||||
log_printf (" last_exec.tv_sec . . : %ld\n", HOOK_TIMER(ptr_hook, last_exec.tv_sec));
|
||||
log_printf (" last_exec.tv_usec. . : %ld\n", HOOK_TIMER(ptr_hook, last_exec.tv_usec));
|
||||
break;
|
||||
case HOOK_TYPE_FD:
|
||||
weechat_log_printf (" fd data:\n");
|
||||
weechat_log_printf (" fd . . . . . . . . . : %ld\n", HOOK_FD(ptr_hook, fd));
|
||||
weechat_log_printf (" flags. . . . . . . . : %ld\n", HOOK_FD(ptr_hook, flags));
|
||||
log_printf (" fd data:\n");
|
||||
log_printf (" fd . . . . . . . . . : %ld\n", HOOK_FD(ptr_hook, fd));
|
||||
log_printf (" flags. . . . . . . . : %ld\n", HOOK_FD(ptr_hook, flags));
|
||||
break;
|
||||
case HOOK_TYPE_PRINT:
|
||||
weechat_log_printf (" print data:\n");
|
||||
weechat_log_printf (" buffer . . . . . . . : 0x%X\n", HOOK_PRINT(ptr_hook, buffer));
|
||||
weechat_log_printf (" message. . . . . . . : '%s'\n", HOOK_PRINT(ptr_hook, message));
|
||||
log_printf (" print data:\n");
|
||||
log_printf (" buffer . . . . . . . : 0x%X\n", HOOK_PRINT(ptr_hook, buffer));
|
||||
log_printf (" message. . . . . . . : '%s'\n", HOOK_PRINT(ptr_hook, message));
|
||||
break;
|
||||
case HOOK_TYPE_EVENT:
|
||||
weechat_log_printf (" event data:\n");
|
||||
weechat_log_printf (" event. . . . . . . . : '%s'\n", HOOK_EVENT(ptr_hook, event));
|
||||
log_printf (" event data:\n");
|
||||
log_printf (" event. . . . . . . . : '%s'\n", HOOK_EVENT(ptr_hook, event));
|
||||
break;
|
||||
case HOOK_TYPE_CONFIG:
|
||||
weechat_log_printf (" config data:\n");
|
||||
weechat_log_printf (" type . . . . . . . . : '%s'\n", HOOK_CONFIG(ptr_hook, type));
|
||||
weechat_log_printf (" option . . . . . . . : '%s'\n", HOOK_CONFIG(ptr_hook, option));
|
||||
log_printf (" config data:\n");
|
||||
log_printf (" type . . . . . . . . : '%s'\n", HOOK_CONFIG(ptr_hook, type));
|
||||
log_printf (" option . . . . . . . : '%s'\n", HOOK_CONFIG(ptr_hook, option));
|
||||
break;
|
||||
}
|
||||
weechat_log_printf (" running. . . . . . . . : %d\n", ptr_hook->running);
|
||||
weechat_log_printf (" prev_hook. . . . . . . : 0x%X\n", ptr_hook->prev_hook);
|
||||
weechat_log_printf (" next_hook. . . . . . . : 0x%X\n", ptr_hook->next_hook);
|
||||
log_printf (" running. . . . . . . . : %d\n", ptr_hook->running);
|
||||
log_printf (" prev_hook. . . . . . . : 0x%X\n", ptr_hook->prev_hook);
|
||||
log_printf (" next_hook. . . . . . . : 0x%X\n", ptr_hook->next_hook);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -237,9 +237,9 @@ weelist_print_log (struct t_weelist *weelist, char *name)
|
||||
for (ptr_weelist = weelist; ptr_weelist;
|
||||
ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
weechat_log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
|
||||
weechat_log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
|
||||
weechat_log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
|
||||
weechat_log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
|
||||
log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
|
||||
log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
|
||||
log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
|
||||
log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -46,11 +46,11 @@ FILE *weechat_log_file = NULL; /* WeeChat log file */
|
||||
|
||||
|
||||
/*
|
||||
* weechat_log_open: initialize log file
|
||||
* log_open: initialize log file
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_log_open (char *filename, char *mode)
|
||||
log_open (char *filename, char *mode)
|
||||
{
|
||||
int filename_length;
|
||||
|
||||
@@ -95,13 +95,13 @@ weechat_log_open (char *filename, char *mode)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_init: initialize log file
|
||||
* log_init: initialize log file
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_log_init ()
|
||||
log_init ()
|
||||
{
|
||||
if (!weechat_log_open (NULL, "w"))
|
||||
if (!log_open (NULL, "w"))
|
||||
{
|
||||
string_iconv_fprintf (stderr,
|
||||
_("Error: unable to create/append to log file (weechat.log)\n"
|
||||
@@ -112,11 +112,11 @@ weechat_log_init ()
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_printf: write a message in WeeChat log (<weechat_home>/weechat.log)
|
||||
* log_printf: write a message in WeeChat log (<weechat_home>/weechat.log)
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_log_printf (char *message, ...)
|
||||
log_printf (char *message, ...)
|
||||
{
|
||||
static char buffer[4096];
|
||||
char *ptr_buffer;
|
||||
@@ -156,11 +156,11 @@ weechat_log_printf (char *message, ...)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_close: close log file
|
||||
* log_close: close log file
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_log_close ()
|
||||
log_close ()
|
||||
{
|
||||
/* close log file */
|
||||
if (weechat_log_file)
|
||||
@@ -181,11 +181,11 @@ weechat_log_close ()
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_log_crash_rename: rename log file when crashing
|
||||
* log_crash_rename: rename log file when crashing
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_log_crash_rename ()
|
||||
log_crash_rename ()
|
||||
{
|
||||
char *old_name, *new_name;
|
||||
int length;
|
||||
@@ -199,7 +199,7 @@ weechat_log_crash_rename ()
|
||||
if (!old_name)
|
||||
return 0;
|
||||
|
||||
weechat_log_close ();
|
||||
log_close ();
|
||||
|
||||
length = strlen (weechat_home) + 128;
|
||||
new_name = (char *) malloc (length);
|
||||
@@ -218,7 +218,7 @@ weechat_log_crash_rename ()
|
||||
{
|
||||
string_iconv_fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
|
||||
new_name);
|
||||
weechat_log_open (new_name, "a");
|
||||
log_open (new_name, "a");
|
||||
free (old_name);
|
||||
free (new_name);
|
||||
return 1;
|
||||
@@ -227,6 +227,6 @@ weechat_log_crash_rename ()
|
||||
}
|
||||
|
||||
free (old_name);
|
||||
weechat_log_open (NULL, "a");
|
||||
log_open (NULL, "a");
|
||||
return 0;
|
||||
}
|
||||
|
||||
+4
-4
@@ -23,9 +23,9 @@
|
||||
extern char *weechat_log_filename;
|
||||
extern FILE *weechat_log_file;
|
||||
|
||||
extern void weechat_log_init ();
|
||||
extern void weechat_log_close ();
|
||||
extern void weechat_log_printf (char *, ...);
|
||||
extern int weechat_log_crash_rename ();
|
||||
extern void log_init ();
|
||||
extern void log_close ();
|
||||
extern void log_printf (char *, ...);
|
||||
extern int log_crash_rename ();
|
||||
|
||||
#endif /* wee-log.h */
|
||||
|
||||
+14
-14
@@ -464,8 +464,8 @@ weechat_welcome_message ()
|
||||
"%s-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-",
|
||||
GUI_COLOR(GUI_COLOR_CHAT_NICK));
|
||||
|
||||
weechat_log_printf ("%s (%s %s %s)\n",
|
||||
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
|
||||
log_printf ("%s (%s %s %s)\n",
|
||||
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -479,7 +479,7 @@ weechat_shutdown (int return_code, int crash)
|
||||
free (weechat_argv0);
|
||||
if (weechat_home)
|
||||
free (weechat_home);
|
||||
weechat_log_close ();
|
||||
log_close ();
|
||||
if (local_charset)
|
||||
free (local_charset);
|
||||
alias_free_all ();
|
||||
@@ -504,19 +504,19 @@ weechat_dump (int crash)
|
||||
if (crash)
|
||||
{
|
||||
sigsegv = 1;
|
||||
weechat_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
|
||||
log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
|
||||
}
|
||||
|
||||
weechat_log_printf ("\n");
|
||||
log_printf ("\n");
|
||||
if (crash)
|
||||
{
|
||||
weechat_log_printf ("****** WeeChat CRASH DUMP ******\n");
|
||||
weechat_log_printf ("****** Please send this file to WeeChat developers ******\n");
|
||||
weechat_log_printf ("****** and explain when this crash happened ******\n");
|
||||
log_printf ("****** WeeChat CRASH DUMP ******\n");
|
||||
log_printf ("****** Please send this file to WeeChat developers ******\n");
|
||||
log_printf ("****** and explain when this crash happened ******\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_log_printf ("****** WeeChat dump request ******\n");
|
||||
log_printf ("****** WeeChat dump request ******\n");
|
||||
}
|
||||
|
||||
gui_window_print_log ();
|
||||
@@ -527,9 +527,9 @@ weechat_dump (int crash)
|
||||
|
||||
plugin_print_log ();
|
||||
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf ("****** End of dump ******\n");
|
||||
weechat_log_printf ("\n");
|
||||
log_printf ("\n");
|
||||
log_printf ("****** End of dump ******\n");
|
||||
log_printf ("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -545,7 +545,7 @@ weechat_sigsegv ()
|
||||
|
||||
string_iconv_fprintf (stderr, "\n");
|
||||
string_iconv_fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
|
||||
if (!weechat_log_crash_rename ())
|
||||
if (!log_crash_rename ())
|
||||
string_iconv_fprintf (stderr,
|
||||
"*** Full crash dump was saved to %s/weechat.log file.\n",
|
||||
weechat_home);
|
||||
@@ -594,7 +594,7 @@ main (int argc, char *argv[])
|
||||
gui_keyboard_init (); /* init keyb. (default key bindings)*/
|
||||
weechat_parse_args (argc, argv); /* parse command line args */
|
||||
weechat_create_home_dirs (); /* create WeeChat directories */
|
||||
weechat_log_init (); /* init log file */
|
||||
log_init (); /* init log file */
|
||||
if (weechat_config_read () < 0) /* read WeeChat configuration */
|
||||
exit (EXIT_FAILURE);
|
||||
command_index_build (); /* build cmd index for completion */
|
||||
|
||||
Reference in New Issue
Block a user