Repository: dbt-labs/dbt-core

Issue:
[CT-2390] Petite laideur in v1.5 logging: `ListRelations`
_Similar to #7255_

The appearance of the `message` for the `ListRelations` event (which generally happens in the case of a cache miss) just kinda bugs me:
```
21:32:55.954074 [debug] [Thread-1  ]: with database=jerco, schema=dbt_jcohen, relations=[database: "jerco"
schema: "dbt_jcohen"
identifier: "my_cool_alias"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "dim_customers"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "my_good_model"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "other_table"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "my_tbl"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "another_model"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "customers"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "seed"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "some_tbl"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "some_file"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "my_failing_model"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "my_model"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "my_seed"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "events"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "layer1"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "model_a"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "my_sql_model"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "model_b"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "important_model"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "foo"
, database: "jerco"
schema: "dbt_jcohen"
identifier: "employees"
]
```

In previous versions of dbt-core, before we made the switch to using Google's proto library for event serialization, the event looked like:
```
19:45:28.000359 [debug] [Thread-1  ]: with database=jerco, schema=dbt_jcohen, relations=[ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_cool_alias'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='dim_customers'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_good_model'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='other_table'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_tbl'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='another_model'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='customers'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='seed'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='some_tbl'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='some_file'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_failing_model'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_seed'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='events'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='layer1'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='model_a'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_sql_model'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='model_b'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='my_model'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='important_model'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='foo'), ReferenceKeyMsg(database='jerco', schema='dbt_jcohen', identifier='employees')]
```

I'd rather it be something like:
```
21:43:36.371027 [debug] [Thread-1  ]: While listing relations in database=jerco, schema=dbt_jcohen, found: my_cool_alias, dim_customers, my_good_model, other_table, my_tbl, another_model, customers, seed, some_tbl, some_file, my_failing_model, my_seed, events, layer1, model_a, my_model, my_sql_model, model_b, important_model, foo, employees
```


Discussion:

Resolving patch:
diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py
--- a/core/dbt/events/types.py
+++ b/core/dbt/events/types.py
@@ -524,7 +524,8 @@ def code(self):
         return "E014"
 
     def message(self) -> str:
-        return f"with database={self.database}, schema={self.schema}, relations={self.relations}"
+        identifiers_str = ", ".join(r.identifier for r in self.relations)
+        return f"While listing relations in database={self.database}, schema={self.schema}, found: {identifiers_str}"
 
 
 class ConnectionUsed(DebugLevel):


Test patch: