logger

package
v0.0.0-...-3e76ffc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLogger

type AccessLogger interface {
	io.Closer
	// NewLogin is called when a new login has happened and was answered with the given status
	NewLogin(connection ConnectionInfo, status string)
	// Logout is called when a logout happens
	Logout(connection ConnectionInfo)
	// NewAccess is called when a new file has been requested at the given path
	// for the given kind (MkDir, Read, Write, etc.) and was answered with the given status (e.g. granted)
	NewAccess(connection ConnectionInfo, path string, kind string, status string)
}

AccessLogger is an interface that adds method for logging ssh related actions

func NewAccessLogger

func NewAccessLogger(writer io.Writer) AccessLogger

NewAccessLogger creates a new standard AccessLogger that prints all output to the given writer

type ConnectionInfo

type ConnectionInfo struct {
	IP       string
	Username string
}

ConnectionInfo contains meta information about a new ssh connection

type Logger

type Logger interface {
	io.Closer
	// Warn prints a warning msg under the given tag
	Warn(tag string, msg string)
	// Err prints an error under the given tag
	Err(tag string, msg string)
	// Debug prints a debug output under the given tag
	Debug(tag string, msg string)
	// Info prints a info output under the given tag
	Info(tag string, msg string)
}

Logger is interface for basic logging methods

func NewLogger

func NewLogger(writer io.Writer) Logger

NewLogger creates a new Logger implementation that writes all outputs to the given writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL