{"modulePath":"github.com/ocelot-cloud/deepstack","version":"v0.1.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package deepstack\n\n## Functions\n\n```go\nfunc AssertDeepStackError(t *testing.T, err error, expectedMessage string, expectedContext ...any)\n```\n\n```go\nfunc NewJsonConsoleHandler(level slog.Level) *slog.JSONHandler\n```\n\n## Types\n\n```go\ntype ConsoleHandler struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRawConsoleHandler(level slog.Level) *ConsoleHandler\n```\n\n```go\nfunc (s ConsoleHandler) Enabled(_ context.Context, lvl slog.Level) bool\n```\n\n```go\nfunc (s ConsoleHandler) Handle(_ context.Context, r slog.Record) error\n```\n\n```go\nfunc (s ConsoleHandler) WithAttrs(a []slog.Attr) slog.Handler\n```\n\n```go\nfunc (s ConsoleHandler) WithGroup(string) slog.Handler\n```\n\n```go\ntype DeepStackError struct {\n\tMessage    string\n\tStackTrace string\n\tContext    map[string]any\n}\n```\n\n```go\nfunc (d *DeepStackError) Error() string\n```\nError returns all fields, so the logs clearly show when an error has been wrapped incorrectly multiple times by different layers.\n\n```go\ntype DeepStackLogger interface {\n\tDebug(msg any, context ...any)\n\tInfo(msg any, context ...any)\n\tWarn(msg any, context ...any)\n\tError(msg any, context ...any)\n\tNewError(msg string, context ...any) error\n\tAddContext(err error, context ...any) error\n}\n```\n\n```go\nfunc NewDeepStackLogger(additionalHandlers ...slog.Handler) DeepStackLogger\n```\n\n```go\ntype DeepStackLoggerImpl struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *DeepStackLoggerImpl) AddContext(err error, context ...any) error\n```\n\n```go\nfunc (m *DeepStackLoggerImpl) Debug(msgOrErr any, context ...any)\n```\n\n```go\nfunc (m *DeepStackLoggerImpl) Error(msgOrErr any, context ...any)\n```\n\n```go\nfunc (m *DeepStackLoggerImpl) Info(msgOrErr any, context ...any)\n```\n\n```go\nfunc (m *DeepStackLoggerImpl) NewError(msg string, context ...any) error\n```\n\n```go\nfunc (m *DeepStackLoggerImpl) Warn(msgOrErr any, context ...any)\n```\n\n```go\ntype LoggingBackend interface {\n\tShouldLogBeSkipped(level slog.Level) bool\n\tLogRecord(logRecord *Record)\n\tPrintStackTrace(message string)\n\tLogWarning(message string, kv ...any)\n}\n```\n\n```go\ntype LoggingBackendImpl struct {\n\t// contains filtered or unexported fields\n}\n```\nTODO add tests, maybe also dependencies, hide slog dependency somehow?\n\n```go\nfunc (s *LoggingBackendImpl) LogRecord(logRecord *Record)\n```\n\n```go\nfunc (s *LoggingBackendImpl) LogWarning(message string, kv ...any)\n```\n\n```go\nfunc (s *LoggingBackendImpl) PrintStackTrace(stackTrace string)\n```\n\n```go\nfunc (s *LoggingBackendImpl) ShouldLogBeSkipped(level slog.Level) bool\n```\n\n```go\ntype Record struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r *Record) AddAttrs(key string, value any)\n```\n\n```go\ntype StackTracer interface {\n\tGetStackTrace() string\n}\n```\n\n```go\ntype StackTracerImpl struct{}\n```\n\n```go\nfunc (s *StackTracerImpl) GetStackTrace() string\n```\n\n","path":"github.com/ocelot-cloud/deepstack","name":"deepstack","synopsis":"","isRedistributable":true}
