{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package logger\n\n## Constants\n\n```go\nconst (\n\tFieldRequestID = \"request_id\"\n\tFieldUserID    = \"user_id\"\n\tFieldOrgID     = \"org_id\"\n\tFieldClusterID = \"cluster_id\"\n\tFieldStackID   = \"stack_id\"\n\tFieldReleaseID = \"release_id\"\n\tFieldResource  = \"resource\"\n\tFieldComponent = \"component\"\n)\n```\nField name constants for structured logging. Callers attach these via WithField/WithFields instead of interpolating IDs into message strings.\n\n## Functions\n\n```go\nfunc AddLoggerToContext(ctx context.Context, logger Logger) context.Context\n```\n\n```go\nfunc RequestIDFromContext(ctx context.Context) (string, bool)\n```\n\n```go\nfunc WithClusterID(ctx context.Context, id string) context.Context\n```\n\n```go\nfunc WithOrgID(ctx context.Context, id string) context.Context\n```\n\n```go\nfunc WithRequestID(ctx context.Context, id string) context.Context\n```\nWithRequestID stamps a request/correlation ID onto the context so every context-aware log call made downstream carries it as a structured field.\n\n```go\nfunc WithUserID(ctx context.Context, id string) context.Context\n```\n\n## Types\n\n```go\ntype Logger interface {\n\tSetLevel(level logrus.Level) Logger\n\n\tGetLevel() logrus.Level\n\n\t// WithField returns a child logger that attaches the given key/value to\n\t// every subsequent log entry. The parent is left unchanged.\n\tWithField(key string, value interface{}) Logger\n\n\t// WithFields returns a child logger that attaches all the given fields to\n\t// every subsequent log entry. The parent is left unchanged.\n\tWithFields(fields map[string]interface{}) Logger\n\n\tDebugEnabled() bool\n\n\t// InfoEnabled returns true if the information level is enabled.\n\tInfoEnabled() bool\n\n\t// WarnEnabled returns true if the warning level is enabled.\n\tWarnEnabled() bool\n\n\t// ErrorEnabled returns true if the error level is enabled.\n\tErrorEnabled() bool\n\n\t// Debug sends to the log a debug message formatted using the fmt.Sprintf function and the\n\t// given format and arguments.\n\tDebug(ctx context.Context, format string, args ...interface{})\n\n\t// Info sends to the log an information message formatted using the fmt.Sprintf function and\n\t// the given format and arguments.\n\tInfof(format string, args ...interface{})\n\n\tInfo(ctx context.Context, format string, args ...interface{})\n\n\t// Warn sends to the log a warning message formatted using the fmt.Sprintf function and the\n\t// given format and arguments.\n\tWarn(ctx context.Context, format string, args ...interface{})\n\n\t// Error sends to the log an error message formatted using the fmt.Sprintf function and\n\t// the given format and arguments.\n\tError(ctx context.Context, format string, args ...interface{})\n\n\tErrorf(format string, args ...interface{})\n\tDebugf(format string, args ...interface{})\n\tFatalf(format string, args ...interface{})\n\tWarnf(format string, args ...interface{})\n\n\t// Fatal sends to the log an error message formatted using the fmt.Sprintf function and\n\t// the given format and arguments; and then executes an os.Exit(1)\n\t// Fatal level is always enabled\n\tFatal(ctx context.Context, format string, args ...interface{})\n}\n```\n\n```go\nfunc GetLoggerFromContext(ctx context.Context) Logger\n```\n\n```go\nfunc NewLogger() Logger\n```\nNewLogger creates a new logger instance with standard configuration\n\n```go\nfunc NewLoggerWithDebug(ctx context.Context) Logger\n```\n\n```go\nfunc NewLoggerWithPrefix(ctx context.Context, prefix string) Logger\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/logger","name":"logger","synopsis":"","isRedistributable":true}
