mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Option to revert to default logging function after using a custom one.
This commit is contained in:
parent
607131b624
commit
1f86c3397e
@ -28,8 +28,8 @@ typedef void (*dm_log_fn) (int level, const char *file, int line,
|
||||
|
||||
/*
|
||||
* The library user may wish to register their own
|
||||
* logging function, by default errors go to
|
||||
* stderr.
|
||||
* logging function, by default errors go to stderr.
|
||||
* Use dm_log_init(NULL) to restore the default log fn.
|
||||
*/
|
||||
void dm_log_init(dm_log_fn fn);
|
||||
void dm_log_init_verbose(int level);
|
||||
|
@ -56,7 +56,10 @@ dm_log_fn _log = _default_log;
|
||||
|
||||
void dm_log_init(dm_log_fn fn)
|
||||
{
|
||||
_log = fn;
|
||||
if (fn)
|
||||
_log = fn;
|
||||
else
|
||||
_log = _default_log;
|
||||
}
|
||||
|
||||
void dm_log_init_verbose(int level)
|
||||
|
Loading…
Reference in New Issue
Block a user