File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,25 @@ pub fn syslog<S: AsRef<OsStr> + ?Sized>(priority: Priority, message: &S) {
2929 unsafe { libc:: syslog ( priority. 0 , formatter. as_ptr ( ) , message. as_ptr ( ) ) }
3030}
3131
32+ /// Closes the log file.
33+ pub fn closelog ( ) {
34+ unsafe { libc:: closelog ( ) }
35+ }
36+
37+ /// Sets the log priority mask to `maskpri` and returns the previous mask.
38+ ///
39+ /// A process has a log priority mask that determines which calls to [`syslog`] may be logged.
40+ /// All other calls will be ignored. Logging is enabled for the priorities that have the
41+ /// corresponding bit set in `maskpri`. The initial mask is such that logging is enabled for all
42+ /// priorities.
43+ ///
44+ /// The [`setlogmask`] function sets this mask for the calling process, and returns the previous
45+ /// mask. If `maskpri` is 0, the current log mask is not modified.
46+ pub fn setlogmask ( maskpri : libc:: c_int ) -> libc:: c_int {
47+ let mask = unsafe { libc:: setlogmask ( maskpri) } ;
48+ mask
49+ }
50+
3251/// The priority for a log message.
3352#[ derive( Debug , Clone , Copy ) ]
3453pub struct Priority ( libc:: c_int ) ;
You can’t perform that action at this time.
0 commit comments