Documentation ¶
Overview ¶
Package logging contains framework internal helpers for consistent logger and log entry handling.
Index ¶
- Constants
- func FrameworkDebug(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkError(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkWithAttributePath(ctx context.Context, attributePath string) context.Context
- func InitContext(ctx context.Context) context.Context
Constants ¶
const ( // Attribute path representation, which is typically in flatmap form such // as parent.0.child in this project. KeyAttributePath = "tf_attribute_path" // The type of data source being operated on, such as "archive_file" KeyDataSourceType = "tf_data_source_type" // The Deferred reason for an RPC response KeyDeferredReason = "tf_deferred_reason" // Human readable string when calling a provider defined type that must // implement the Description() method, such as validators. KeyDescription = "description" // Underlying Go error string when logging an error. KeyError = "error" // The name of function being operated on, such as "parse_xyz" KeyFunctionName = "tf_function_name" // The type of resource being operated on, such as "random_pet" KeyResourceType = "tf_resource_type" // The type of value being operated on, such as "JSONStringValue". KeyValueType = "tf_value_type" )
Structured logging keys.
Practitioners or tooling reading logs may be depending on these keys, so be conscious of that when changing them.
Refer to the terraform-plugin-go logging keys as well, which should be equivalent to these when possible.
const ( // EnvTfLogSdkFramework is an environment variable that sets the logging // level of SDK framework loggers. Infers root SDK logging level, if // unset. EnvTfLogSdkFramework = "TF_LOG_SDK_FRAMEWORK" )
Environment variables.
const (
// SubsystemFramework is the tfsdklog subsystem name for framework.
SubsystemFramework = "framework"
)
Variables ¶
This section is empty.
Functions ¶
func FrameworkDebug ¶
FrameworkDebug emits a framework subsystem log at DEBUG level.
func FrameworkError ¶
FrameworkError emits a framework subsystem log at ERROR level.
func FrameworkTrace ¶
FrameworkTrace emits a framework subsystem log at TRACE level.
func FrameworkWarn ¶
FrameworkWarn emits a framework subsystem log at WARN level.
func FrameworkWithAttributePath ¶
FrameworkWithAttributePath returns a new Context with KeyAttributePath set. The attribute path is expected to be string, so the logging package does not need to import path handling code.
Types ¶
This section is empty.