Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Level reports the minimum level to log.
// Levels with lower levels are discarded.
// If nil, the Handler uses [slog.LevelInfo].
Level slog.Leveler
}
Options configures the behavior of the PluginHandler.
type PluginHandler ¶
type PluginHandler struct {
// contains filtered or unexported fields
}
PluginHandler implements slog.Handler to integrate Go's structured logging with OpenVPN's plugin logging system. It forwards log messages to OpenVPN using the plugin_log callback function.
func NewOpenVPNPluginLogger ¶
func NewOpenVPNPluginLogger(cb *c.OpenVPNPluginCallbacks) *PluginHandler
NewOpenVPNPluginLogger creates a new PluginHandler that sends log messages to OpenVPN via the plugin callback interface.
Parameters:
- cb: OpenVPN plugin callbacks structure containing the plugin_log function
- opts: Optional configuration for the handler (can be nil for defaults)
Returns:
- *PluginHandler: A new handler that implements slog.Handler
Click to show internal directories.
Click to hide internal directories.