[Issue 23487] std.experimental.logger assigning FileLogger to sharedLog no longer works
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 5 15:49:08 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=23487
Bastiaan Veelo <Bastiaan at Veelo.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Bastiaan at Veelo.net
--- Comment #3 from Bastiaan Veelo <Bastiaan at Veelo.net> ---
There is a PR to adjust the documentation for this
(https://github.com/dlang/phobos/pull/8995) but, as Nicholas Wilson points out,
the correct syntax would be
```d
sharedLog = new shared(FileLogger)(yourFile);
```
This does not work since there is currently no shared constructor. I have tried
to implement one in https://github.com/dlang/phobos/pull/8996, but that's way
harder than I expected. I hope somebody smarter than me will be able to,
because the difficulty of it suggests to me that just casting to shared is not
a good solution.
--
More information about the Digitalmars-d-bugs
mailing list