Jump to page: 1 2
Thread overview
Example code in std.logger.core doesn't even work
Mar 13, 2023
Yuxuan Shui
Mar 13, 2023
Johann Lermer
Mar 13, 2023
Yuxuan Shui
Mar 13, 2023
Johann Lermer
Mar 13, 2023
WebFreak001
Mar 13, 2023
Yuxuan Shui
Mar 18, 2023
James Blachly
Jul 12
mw
Jul 12
mw
Jul 13
mw
Jul 13
Danilo
Jul 18
IchorDev
Jul 20
o3o
March 13, 2023

Example here:

https://dlang.org/phobos/std_logger_core.html#.sharedLog

Result:

https://run.dlang.io/is/RMtF0I

March 13, 2023

Try this:

auto sharedLog = new FileLogger("/dev/null");

March 13, 2023

On Monday, 13 March 2023 at 10:03:59 UTC, Johann Lermer wrote:

>

Try this:

auto sharedLog = new FileLogger("/dev/null");

This also works, but is likely thread unsafe:

sharedLog = cast(shared)new FileLogger("/dev/null");
March 13, 2023

On Monday, 13 March 2023 at 10:03:59 UTC, Johann Lermer wrote:

>

Try this:

auto sharedLog = new FileLogger("/dev/null");

That defines a new variable right. That's completely different.

March 13, 2023

On Monday, 13 March 2023 at 15:48:03 UTC, Yuxuan Shui wrote:

>

On Monday, 13 March 2023 at 10:03:59 UTC, Johann Lermer wrote:

>

Try this:

auto sharedLog = new FileLogger("/dev/null");

That defines a new variable right. That's completely different.

Ah, sh..t. Didn't see that.

March 13, 2023

On Monday, 13 March 2023 at 02:53:00 UTC, Yuxuan Shui wrote:

>

Example here:

https://dlang.org/phobos/std_logger_core.html#.sharedLog

Result:

https://run.dlang.io/is/RMtF0I

this changed in one of the most recent releases, but you can always expect breaking changes in an std.experimental module

March 13, 2023

On Monday, 13 March 2023 at 20:32:08 UTC, WebFreak001 wrote:

>

On Monday, 13 March 2023 at 02:53:00 UTC, Yuxuan Shui wrote:

>

Example here:

https://dlang.org/phobos/std_logger_core.html#.sharedLog

Result:

https://run.dlang.io/is/RMtF0I

this changed in one of the most recent releases, but you can always expect breaking changes in an std.experimental module

Breaking change is fine... I expect documentation to be updated with the change.

March 17, 2023
On 3/13/23 4:32 PM, WebFreak001 wrote:
> On Monday, 13 March 2023 at 02:53:00 UTC, Yuxuan Shui wrote:
>> Example here:
>>
>> https://dlang.org/phobos/std_logger_core.html#.sharedLog
>>
>> Result:
>>
>> https://run.dlang.io/is/RMtF0I
> 
> this changed in one of the most recent releases, but you can always expect breaking changes in an std.experimental module

It is no longer namespaced under std.experimental, so I would not expect breaking changes
July 12

On Monday, 13 March 2023 at 20:32:08 UTC, WebFreak001 wrote:

>

On Monday, 13 March 2023 at 02:53:00 UTC, Yuxuan Shui wrote:

>

Example here:

https://dlang.org/phobos/std_logger_core.html#.sharedLog

Result:

https://run.dlang.io/is/RMtF0I

this changed in one of the most recent releases, but you can always expect breaking changes in an std.experimental module

Can you please show the correct usage pattern of this sharedLog, in the new release?

July 12

On Wednesday, 12 July 2023 at 03:00:11 UTC, mw wrote:

>

On Monday, 13 March 2023 at 20:32:08 UTC, WebFreak001 wrote:

>

On Monday, 13 March 2023 at 02:53:00 UTC, Yuxuan Shui wrote:

>

Example here:

https://dlang.org/phobos/std_logger_core.html#.sharedLog

Result:

https://run.dlang.io/is/RMtF0I

this changed in one of the most recent releases, but you can always expect breaking changes in an std.experimental module

Can you please show the correct usage pattern of this sharedLog, in the new release?

what I do now in my code:

static if (__VERSION__ < 2101)
	sharedLog = new FileLogger(io.stderr);
else
	sharedLog = (() @trusted => cast(shared) new FileLogger(io.stderr))();

not a big fan of the changes and the fact that this got made std.logger instead of the previous API, but it works at least

« First   ‹ Prev
1 2