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) {
29
29
unsafe { libc:: syslog ( priority. 0 , formatter. as_ptr ( ) , message. as_ptr ( ) ) }
30
30
}
31
31
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
+
32
51
/// The priority for a log message.
33
52
#[ derive( Debug , Clone , Copy ) ]
34
53
pub struct Priority ( libc:: c_int ) ;
You can’t perform that action at this time.
0 commit comments