Often times, large weights for ML models will be stored as resources in MLIR. It is sometimes advantageous to control whether to print these resources for debugging purposes. For example, some models contain very big weights with millions of characters in printed size, which may slow down whatever text editor you are using.
This diff adds a flag which allows users to disable printing resources in these scenarios.
As a minor optimization, can you skip the string buffer if charLimit is not defined?