Struct syslog_rs::syslog_sync::Syslog[][src]

pub struct Syslog { /* fields omitted */ }
Expand description

A common instance which describes the syslog state

Implementations

A public implementations

As in a libc, this function initializes the syslog instance. The main difference with realization in C is it returns the instance to program used this crate. This structure implements the Send and Sync so it does not require any additional synchonization.

Arguments

  • ident - a identification of the sender. If not set, the crate will determine automatically!

  • logstat - sets up the syslog behaviour. Use LogStat

  • facility - a syslog facility. Use LogFacility

Returns

  • A SyRes with instance or Err()

Example

 Syslog::openlog(
       Some("test1"), 
        LogStat::LOG_NDELAY | LogStat::LOG_PID, 
        LogFacility::LOG_DAEMON);

Sets the logmask to filter out the syslog calls.

See macroses [common::LOG_MASK] and [common::LOG_UPTO] to generate mask

Example

LOG_MASK!(Priority::LOG_EMERG) | LOG_MASK!(Priority::LOG_ERROR)

or

~(LOG_MASK!(Priority::LOG_INFO)) LOG_UPTO!(Priority::LOG_ERROR)

Similar to libc, closelog() will close the log

Similar to libc, syslog() sends data to syslog server.

Arguments

  • pri - a priority Priority

  • fmt - a string message. In C exists a functions with variable argumets amount. In Rust you should create your own macros like format!() or use format!()

Similar to syslog() and created for the compatability.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.