@@ -93,7 +93,7 @@ func (ce *companyEnrich) query(e *et.Event, ident *dbt.Entity, apikey []string)
93
93
orgent := ce .lookup (e , ident , time.Time {})
94
94
if orgent == nil {
95
95
msg := fmt .Sprintf ("failed to find the Organization asset for %s" , oamid .UniqueID )
96
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
96
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
97
97
return nil , nil
98
98
}
99
99
@@ -110,19 +110,19 @@ func (ce *companyEnrich) query(e *et.Event, ident *dbt.Entity, apikey []string)
110
110
resp , err := http .RequestWebPage (ctx , & http.Request {URL : u , Header : headers })
111
111
if err != nil {
112
112
msg := fmt .Sprintf ("failed to obtain the company enrich result for %s: %s" , oamid .ID , err )
113
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
113
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
114
114
continue
115
115
} else if resp .StatusCode != 200 {
116
116
msg := fmt .Sprintf ("failed to obtain the company enrich result for %s: %s" , oamid .ID , resp .Status )
117
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
117
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
118
118
continue
119
119
} else if resp .Body == "" {
120
120
msg := fmt .Sprintf ("failed to obtain the company enrich result for %s: empty body" , oamid .ID )
121
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
121
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
122
122
continue
123
123
} else if strings .Contains (resp .Body , "error" ) {
124
124
msg := fmt .Sprintf ("failed to obtain the company enrich result for %s: %s" , oamid .ID , resp .Body )
125
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
125
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
126
126
continue
127
127
}
128
128
@@ -131,7 +131,7 @@ func (ce *companyEnrich) query(e *et.Event, ident *dbt.Entity, apikey []string)
131
131
enrich = & result
132
132
} else {
133
133
msg := fmt .Sprintf ("failed to unmarshal the company enrich result for %s: %s" , oamid .ID , err )
134
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
134
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
135
135
}
136
136
break
137
137
}
@@ -165,7 +165,7 @@ func (ce *companyEnrich) store(e *et.Event, orgent *dbt.Entity, data *companyEnr
165
165
ident , err := e .Session .Cache ().CreateAsset (oamid )
166
166
if err != nil || ident == nil {
167
167
msg := fmt .Sprintf ("failed to create the Identifier asset for %s: %s" , o .LegalName , err )
168
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
168
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
169
169
return
170
170
}
171
171
@@ -175,22 +175,22 @@ func (ce *companyEnrich) store(e *et.Event, orgent *dbt.Entity, data *companyEnr
175
175
})
176
176
if err != nil {
177
177
msg := fmt .Sprintf ("failed to create the SourceProperty for %s: %s" , o .LegalName , err )
178
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
178
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
179
179
return
180
180
}
181
181
182
182
err = ce .plugin .createRelation (e .Session , orgent , general.SimpleRelation {Name : "id" }, ident , ce .plugin .source .Confidence )
183
183
if err != nil {
184
184
msg := fmt .Sprintf ("failed to create the relation for %s: %s" , o .LegalName , err )
185
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
185
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
186
186
return
187
187
}
188
188
}
189
189
// update entity
190
190
_ , err := e .Session .Cache ().CreateEntity (orgent )
191
191
if err != nil {
192
192
msg := fmt .Sprintf ("failed to update the Organization asset for %s: %s" , o .Name , err )
193
- e .Session .Log ().Error ("msg" , msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
193
+ e .Session .Log ().Error (msg , slog .Group ("plugin" , "name" , ce .plugin .name , "handler" , ce .name ))
194
194
return
195
195
}
196
196
}
0 commit comments