lisette-stdlib 0.3.4

Little language inspired by Rust that compiles to Go
Documentation
// Generated by Lisette bindgen
// Source: log/syslog (Go stdlib)
// Go: 1.25.10
// Lisette: 0.3.0

import "go:log"

/// The Priority is a combination of the syslog facility and
/// severity. For example, [LOG_ALERT] | [LOG_FTP] sends an alert severity
/// message from the FTP facility. The default severity is [LOG_EMERG];
/// the default facility is [LOG_KERN].
pub struct Priority(int)

pub const LOG_ALERT: Priority = 1

pub const LOG_AUTH: Priority = 32

pub const LOG_AUTHPRIV: Priority = 80

pub const LOG_CRIT: Priority = 2

pub const LOG_CRON: Priority = 72

pub const LOG_DAEMON: Priority = 24

pub const LOG_DEBUG: Priority = 7

pub const LOG_EMERG: Priority = 0

pub const LOG_ERR: Priority = 3

pub const LOG_FTP: Priority = 88

pub const LOG_INFO: Priority = 6

pub const LOG_KERN: Priority = 0

pub const LOG_LOCAL0: Priority = 128

pub const LOG_LOCAL1: Priority = 136

pub const LOG_LOCAL2: Priority = 144

pub const LOG_LOCAL3: Priority = 152

pub const LOG_LOCAL4: Priority = 160

pub const LOG_LOCAL5: Priority = 168

pub const LOG_LOCAL6: Priority = 176

pub const LOG_LOCAL7: Priority = 184

pub const LOG_LPR: Priority = 48

pub const LOG_MAIL: Priority = 16

pub const LOG_NEWS: Priority = 56

pub const LOG_NOTICE: Priority = 5

pub const LOG_SYSLOG: Priority = 40

pub const LOG_USER: Priority = 8

pub const LOG_UUCP: Priority = 64

pub const LOG_WARNING: Priority = 4

/// Dial establishes a connection to a log daemon by connecting to
/// address raddr on the specified network. Each write to the returned
/// writer sends a log message with the facility and severity
/// (from priority) and tag. If tag is empty, the [os.Args][0] is used.
/// If network is empty, Dial will connect to the local syslog server.
/// Otherwise, see the documentation for net.Dial for valid values
/// of network and raddr.
pub fn Dial(network: string, raddr: string, priority: Priority, tag: string) -> Result<Ref<Writer>, error>

/// New establishes a new connection to the system log daemon. Each
/// write to the returned writer sends a log message with the given
/// priority (a combination of the syslog facility and severity) and
/// prefix tag. If tag is empty, the [os.Args][0] is used.
pub fn New(priority: Priority, tag: string) -> Result<Ref<Writer>, error>

/// NewLogger creates a [log.Logger] whose output is written to the
/// system log service with the specified priority, a combination of
/// the syslog facility and severity. The logFlag argument is the flag
/// set passed through to [log.New] to create the Logger.
pub fn NewLogger(p: Priority, logFlag: int) -> Result<Ref<log.Logger>, error>

/// A Writer is a connection to a syslog server.
pub type Writer

impl Writer {
  /// Alert logs a message with severity [LOG_ALERT], ignoring the severity
  /// passed to New.
  fn Alert(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Close closes a connection to the syslog daemon.
  #[allow(unused_result)]
  fn Close(self: Ref<Writer>) -> Result<(), error>

  /// Crit logs a message with severity [LOG_CRIT], ignoring the severity
  /// passed to New.
  fn Crit(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Debug logs a message with severity [LOG_DEBUG], ignoring the severity
  /// passed to New.
  fn Debug(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Emerg logs a message with severity [LOG_EMERG], ignoring the severity
  /// passed to New.
  fn Emerg(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Err logs a message with severity [LOG_ERR], ignoring the severity
  /// passed to New.
  fn Err(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Info logs a message with severity [LOG_INFO], ignoring the severity
  /// passed to New.
  fn Info(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Notice logs a message with severity [LOG_NOTICE], ignoring the
  /// severity passed to New.
  fn Notice(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Warning logs a message with severity [LOG_WARNING], ignoring the
  /// severity passed to New.
  fn Warning(self: Ref<Writer>, m: string) -> Result<(), error>

  /// Write sends a log message to the syslog daemon.
  fn Write(self: Ref<Writer>, b: Slice<byte>) -> Partial<int, error>
}