ArcGIS Pro 2.7 API Reference Guide
Messages Property
Example 

ArcGIS.Desktop.Core.Geoprocessing Namespace > IGPResult Interface : Messages Property
All output messages. To filter only one type of messages use GPMessageType (Warning, Error) - see code example below.
Syntax
Example
var warnings = result.Messages.Where(it => it.Type == GPMessageType.Warning);
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

IGPResult Interface
IGPResult Members