@@ -17,6 +17,10 @@ use crate::log::status::Status;
17
17
use crate :: util:: string:: to_c;
18
18
19
19
/// Convenience function to direct all logging to stdout.
20
+ ///
21
+ /// This function is equivalent to using [`pactffi_logger_init`] followed by the
22
+ /// [`pactffi_logger_attach_sink`] with the appropriate sink specifier, and then
23
+ /// [`pactffi_logger_apply`].
20
24
#[ no_mangle]
21
25
pub extern "C" fn pactffi_log_to_stdout ( level_filter : LevelFilter ) -> c_int {
22
26
pactffi_logger_init ( ) ;
@@ -43,6 +47,10 @@ pub extern "C" fn pactffi_log_to_stdout(level_filter: LevelFilter) -> c_int {
43
47
}
44
48
45
49
/// Convenience function to direct all logging to stderr.
50
+ ///
51
+ /// This function is equivalent to using [`pactffi_logger_init`] followed by the
52
+ /// [`pactffi_logger_attach_sink`] with the appropriate sink specifier, and then
53
+ /// [`pactffi_logger_apply`].
46
54
#[ no_mangle]
47
55
pub extern "C" fn pactffi_log_to_stderr ( level_filter : LevelFilter ) -> c_int {
48
56
pactffi_logger_init ( ) ;
@@ -70,7 +78,13 @@ pub extern "C" fn pactffi_log_to_stderr(level_filter: LevelFilter) -> c_int {
70
78
71
79
/// Convenience function to direct all logging to a file.
72
80
///
81
+ ///
82
+ /// This function is equivalent to using [`pactffi_logger_init`] followed by the
83
+ /// [`pactffi_logger_attach_sink`] with the appropriate sink specifier, and then
84
+ /// [`pactffi_logger_apply`].
85
+ ///
73
86
/// # Safety
87
+ ///
74
88
/// This function will fail if the file_name pointer is invalid or does not point to a NULL
75
89
/// terminated string.
76
90
#[ no_mangle]
@@ -118,8 +132,14 @@ pub unsafe extern "C" fn pactffi_log_to_file(
118
132
Status :: Success as c_int
119
133
}
120
134
121
-
122
135
/// Convenience function to direct all logging to a task local memory buffer.
136
+ ///
137
+ /// This function is equivalent to using [`pactffi_logger_init`] followed by the
138
+ /// [`pactffi_logger_attach_sink`] with the appropriate sink specifier, and then
139
+ /// [`pactffi_logger_apply`].
140
+ ///
141
+ /// The contents of the buffer can be fetched using
142
+ /// [`pactffi_fetch_log_buffer`].
123
143
#[ no_mangle]
124
144
pub extern "C" fn pactffi_log_to_buffer ( level_filter : LevelFilter ) -> c_int {
125
145
pactffi_logger_init ( ) ;
0 commit comments