Skip to content

Commit

Permalink
Add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cheelim1 committed Apr 21, 2023
1 parent 8392e2b commit 54d1f0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/data-sources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use this data source to get information about a Jumpcloud application.
## Example Usage

```hcl
data "jumpcloud_application "example" {
data "jumpcloud_application" "example" {
name = "AWS IAM Identity Center"
display_label = "Example App"
}
Expand Down
4 changes: 4 additions & 0 deletions jumpcloud/data_source_jumpcloud_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package jumpcloud
import (
"context"
"fmt"
"log"

jcapiv1 "github.com/TheJumpCloud/jcapi-go/v1"
jcapiv2 "github.com/TheJumpCloud/jcapi-go/v2"
Expand Down Expand Up @@ -48,6 +49,9 @@ func dataSourceJumpCloudApplicationRead(d *schema.ResourceData, m interface{}) e
applications := applicationsResponse.Results

for _, application := range applications {
log.Printf("[DEBUG] Found application with name '%s' and display label '%s'", application.Name, application.DisplayName)
log.Printf("[DEBUG] Checking application with ID: %s, Name: %s, DisplayName: %s\n", application.Id, application.Name, application.DisplayName)

if (nameExists && application.Name == applicationName) || (displayLabelExists && application.DisplayName == displayLabel) {
d.SetId(application.Id)
return nil
Expand Down

0 comments on commit 54d1f0e

Please sign in to comment.