Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable log levels #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

levaitamas
Copy link

This PR uses the logging levels of the slog package.

Note1: this change slightly alters the output (e.g., [DEBUG] -> DEBUG) and is half-assed.
Note2: if output breaking is not an issue, we can utilize the full power of structured logging in a PR later.

Meanwhile, the loglevel configuration is a matter of calling slog.SetLogLoggerLevel(loglevel) in the example as (the default level is Info):

package main

import (
	"log/slog"

	"github.com/netascode/go-sdwan"
)

func main() {
	slog.SetLogLoggerLevel(slog.LevelDebug)

	client, _ := sdwan.NewClient("1.1.1.1", "user", "pwd", true)

	res, _ := client.Get("/admin/resourcegroup")
	println(res.Get("0.id").String())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant