phobos icon indicating copy to clipboard operation
phobos copied to clipboard

Fix Issue #18491 pass default values as parameter not template parameters in Logger

Open burner opened this issue 6 years ago • 15 comments

https://issues.dlang.org/show_bug.cgi?id=18491

burner avatar Feb 22 '18 14:02 burner

Thanks for your pull request, @burner!

Bugzilla references

Auto-close Bugzilla Severity Description
18491 enhancement std.experimental.logger default values after variadic template parameters

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + phobos#6208"

dlang-bot avatar Feb 22 '18 14:02 dlang-bot

The style checker fails to consider default arguments in ddoc parameter counting. I rechecked by hand and all passable parameters have ddoc comments.

burner avatar Feb 22 '18 14:02 burner

The style checker fails to consider default arguments in ddoc parameter counting. I rechecked by hand and all passable parameters have ddoc comments.

It's not even the style checker per se, but Ddoc.

Check that Ddoc runs without errors
../dmd/generated/linux/debug/64/dmd -conf= -I../druntime/import  -w -de -dip25 -m64 -fPIC -transition=complex -g -debug -defaultlib= -debuglib= generated/linux/debug/64/libphobos2.a -w -D -Df/dev/null -main -c -o- $(find etc std -type f -name '*.d') 2>&1

I think Ddoc expects documentation for parameters like int line = __LINE__. See https://run.dlang.io/is/cW31iD

wilzbach avatar Feb 22 '18 14:02 wilzbach

Not good. I have not the time nor the knowledge to fix ddoc to get this PR passing.

burner avatar Feb 22 '18 14:02 burner

@burner All you have to do is add all of the parameters to the Params section.

JackStouffer avatar Mar 14 '18 14:03 JackStouffer

Jenkins has a build failure for libasync because libasync has its own logging functions that are just nothrow wrappers for std.experimental.logging and call logImpl with explicit __LINE__, etc. template parameters.

n8sh avatar Mar 27 '18 23:03 n8sh

@n8sh thanks

burner avatar Mar 28 '18 09:03 burner

@JackStouffer @wilzbach ping

burner avatar May 05 '18 14:05 burner

What's the way forward on this? To move the current std.experimental.logger to stdx.experimental.logger (like with allocators) and submit a PR to libasync to use that?

n8sh avatar Oct 02 '18 08:10 n8sh

@n8sh sounds like a plan.

PetarKirov avatar Oct 03 '18 06:10 PetarKirov

@n8sh @ZombineDev I do not follow. Please elaborate.

burner avatar Oct 03 '18 13:10 burner

@burner Example of what I was talking about: https://github.com/atilaneves/automem/pull/20 PRs like that were made for several/many? projects that had been using std.experimental.allocator.

n8sh avatar Oct 03 '18 13:10 n8sh

Ok, so we are moving stuff to code.dlang.org and give a version number. So people who don't want to rewrite and link against that!? And after that we change upstream?

burner avatar Oct 03 '18 14:10 burner

@burner yes, this is so they can upgrade to a newer version of stdx and the compiler independently. Very often people use dmd, dmd-beta and even dmd-nightly for CI testing, which makes breaking changes (for which a deprecation period can't be reasonably enforced) especially painful.

PetarKirov avatar Oct 04 '18 05:10 PetarKirov

We can make breaking changes with experimental packages as long as the project tester passes. In this case it's libasync which depends on std.experimental.logger.

Anyhow as you also have other PRs for this module, separating it as a dub module might make moving forward a lot easier for you and people who use the module.

wilzbach avatar Oct 04 '18 17:10 wilzbach