mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 22:06:38 +02:00
Add new features to logger plugin (command /logger, log level, level by buffer, mask by buffer, ..), fix some bugs
New features: - new command /logger - log level, to log only some messages, according to importance (task #8592) - level by buffer: custom level for some buffers (or group of buffers) - log filename mask by buffer (or group of buffers) - marker line is added after display of backlog - add "delete" callback for config file sections - add "mkdir_parents" function to plugin API - remove old log options in IRC plugin Bug fix: - marker line is set only when user switches buffer (not when a plugin force switch, like IRC plugin does when opening server or channel buffer) - backlog fixed (sometimes lines were not properly displayed)
This commit is contained in:
@@ -86,61 +86,6 @@ plugin_api_ngettext (const char *single, const char *plural, int count)
|
||||
return NG_(single, plural, count);
|
||||
}
|
||||
|
||||
/*
|
||||
* plugin_api_mkdir_home: create a directory in WeeChat home
|
||||
* return 1 if ok, 0 if error
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_api_mkdir_home (const char *directory, int mode)
|
||||
{
|
||||
char *dir_name;
|
||||
int dir_length;
|
||||
|
||||
if (!directory)
|
||||
return 0;
|
||||
|
||||
/* build directory, adding WeeChat home */
|
||||
dir_length = strlen (weechat_home) + strlen (directory) + 2;
|
||||
dir_name = malloc (dir_length);
|
||||
if (!dir_name)
|
||||
return 0;
|
||||
|
||||
snprintf (dir_name, dir_length, "%s/%s", weechat_home, directory);
|
||||
|
||||
if (mkdir (dir_name, mode) < 0)
|
||||
{
|
||||
if (errno != EEXIST)
|
||||
{
|
||||
free (dir_name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
free (dir_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* plugin_api_mkdir: create a directory
|
||||
* return 1 if ok, 0 if error
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_api_mkdir (const char *directory, int mode)
|
||||
{
|
||||
if (!directory)
|
||||
return 0;
|
||||
|
||||
if (mkdir (directory, mode) < 0)
|
||||
{
|
||||
if (errno != EEXIST)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* plugin_api_config_get: get value of an option
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user