log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogCmd = &cobra.Command{
	Use:     "log [SERVER NAME]",
	Aliases: []string{"logs"},
	Short:   "Retrieve and display server logs",
	Long: `Retrieve and display logs for a specified server. This command allows you 
	to view logs of different levels and types associated with a server. Use the '--tail' flag 
	to limit the output to the last N log entries. Suitable for debugging and monitoring 
	server activities.`,
	Example: `
	alpacon log [SERVER NAME]
	alpacon logs [SERVER_NAME]
	alpacon log [SERVER NAME] --tail=10
	alpacon logs [SERVER NAME] --tail=10
	`,
	Args: cobra.ExactArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		serverName := args[0]
		pageSize, _ := cmd.Flags().GetInt("tail")

		alpaconClient, err := client.NewAlpaconAPIClient()
		if err != nil {
			utils.CliErrorWithExit("Connection to Alpacon API failed: %s. Consider re-logging.", err)
		}

		logList, err := log.GetSystemLogList(alpaconClient, serverName, pageSize)
		if err != nil {
			utils.CliErrorWithExit("Failed to get logs: %s.", err)
		}

		utils.PrintTable(logList)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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