Data override notifications seem to lack sufficient specificity to be helpful

Howdy all!

quick explanation to reproduce of my experience:

  • running 0.115.0 extended locally (osx)
  • I added the blowfish theme
  • I copied the themes/blowfish/data/sharing.json to data/sharing.json

This creates a hierarchical override, as “(project)/data/datafile” overrides “(project)/themes/$THEMENAME/data/datafile

however, the info message that hugo emits isn’t quite explicit enough here to really be helpful to the user:

INFO  Data for key 'email' in path 'sharing.json' is overridden by higher precedence data already in the data tree
INFO  Data for key 'facebook' in path 'sharing.json' is overridden by higher precedence data already in the data tree
INFO  Data for key 'linkedin' in path 'sharing.json' is overridden by higher precedence data already in the data tree
INFO  Data for key 'pinterest' in path 'sharing.json' is overridden by higher precedence data already in the data tree
INFO  Data for key 'reddit' in path 'sharing.json' is overridden by higher precedence data already in the data tree
INFO  Data for key 'twitter' in path 'sharing.json' is overridden by higher precedence data already in the data tree
INFO  Data for key 'whatsapp' in path 'sharing.json' is overridden by higher precedence data already in the data tree

…As I understand it, Hugo emits these messages while parsing the file (project)/themes/THEMENAME/data/sharing.json
as it discards the listed keys because content in
(project)/data/sharing.json
is given higher precedence.

The problem I’m attempting to illustrate, is that without conveying the full (relative to projectroot) path to the source in question, the source hugo is referring to is ambiguous.

it leaves one with the question

“Hugo, are you discarding content you found in '(projectroot)/data/sharing.json' or are you referring to something else?”

One could be confused into thinking Hugo is telling the user:

“Hi Human, you put some stuff in '(projectroot)/data/sharing.json'… but there is already something in my dataset that has been given higher significance ((somehow))… So I am ignoring your content.
Toodles!”

Would it be problematic (or extra challenging for some reason) to have hugo emit the full path relative to projectroot of the datasource in question when its’ rejecting it?

ie:
instead of:

INFO  Data for key 'email' in path 'sharing.json' is overridden by higher precedence data already in the data tree

Perhaps something like:

INFO  Data for key 'email' in path '||projectroot||themes/[theme]/data/sharing.json' is overridden by higher precedence data already in the data tree

ie:

INFO  Data for key 'email' in path '/themes/blowfish/data/sharing.json' is overridden by higher precedence data already in the data tree

or perhaps taking it a step further:

INFO  Data for key 'email' in path '/themes/blowfish/data/sharing.json' conflicts with higher precedence data already in the data tree... 
... [[ give me a second while I search for that source ... cool found it... ]] 
Using data with higher precedence defined in '/data/sharing.json:55'

Obviously I’m being a hair pedantic here… but I think being a bit more explicit might be helpful.

IMO only listing the filename, sans grounding wrt relevant pathing is confusing at best, if not misleading.

Thoughts?