Skip to content

Commit 6dd1926

Browse files
committed
Update formatting, add comment
1 parent 42d9072 commit 6dd1926

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/command/views/init.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,18 @@ func (v *InitJSON) Output(messageCode InitMessageCode, params ...any) {
9595
return
9696
}
9797

98+
// Logged data includes by default:
99+
// @level as "info"
100+
// @module as "terraform.ui" (See NewJSONView)
101+
// @timestamp formatted in the default way
102+
//
103+
// In the function below we annotate with extra data:
104+
// "type":"init_output"
105+
// "message_code":"<value>"
98106
v.view.log.Info(
99107
preppedMessage,
100-
"type", "init_output", // Add "type":"init_output"
101-
"message_code", string(messageCode), // Add "message_code":"<value>"
108+
"type", "init_output",
109+
"message_code", string(messageCode),
102110
)
103111
}
104112

0 commit comments

Comments
 (0)