logging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package logging provides logger initialization, MCP server logging hooks, and an HTTP round-tripper that logs TheHive requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoggingHooks

func GetLoggingHooks() *server.Hooks

GetLoggingHooks returns the MCP server hooks that log session, resource, prompt, and tool lifecycle events.

func InitLogger

func InitLogger(levelStr, transportType string) *slog.Logger

InitLogger builds a JSON slog.Logger at the given level, sets it as the default, and returns it. In stdio transport mode it writes to stderr so stdout stays reserved for JSON-RPC.

func ParseLevel

func ParseLevel(s string) (slog.Level, error)

ParseLevel parses a textual log level (e.g. "info") into a slog.Level.

Types

type Transport added in v1.0.0

type Transport struct {
	Transport http.RoundTripper
}

Transport wraps an http.RoundTripper to add structured logging

func (*Transport) RoundTrip added in v1.0.0

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper interface

Jump to

Keyboard shortcuts

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