Somehow in the same vein is the work I did in bmakelib:
https://github.com/bahmanm/bmakelib/blob/main/doc/logged.md

On another note, I think for such a feature to be added to Make it should
be a bit more abstract. A couple of ideas that crossed my mind:
- The timestamp format should either be configurable OR default to the
user's locale.
- The log prefix should either be configurable (e.g. passed as a parameter)
OR be in the form of `FILENAME:LINENO`
- Should we stop at `info` and not expand it to implement the well-known
log levels, such as WARN and ERROR?

--

Bahman Movaqar (he/him)https://linktr.ee/bahmanm



On Wed, 2 Jul 2025 at 06:00, xf liao <fxl0...@gmail.com> wrote:

> Hello everyone, my name is Nico, and I’m from China. I’m a senior IT
> systems architect, and I use Make in my daily work to build IT environments.
>
> In my scripts, I have a lot of code like the following to print logs:
> define loginfo =
> @echo "$$(date -d today +'%Y-%m-%d %T') info:  [$(@)]-$(1)"
> endef
> I wish Make had native support for this functionality
> $(info some message)
> so I made some minor modifications to implement it. Now, I’d like to merge
> these changes into the main branch.
>

Reply via email to