Hi,
I am using the Arsd cgi class
(https://github.com/adamdruppe/arsd) to spawn an http server.
Each http request is handled in its own thread. Is it safe to set
in void main a FileLogger to which each thread will write to?
void main()
{
...
sharedLog = new FileLogger("New_Default_Log_File.l
On 19/12/2016 21:32, Robert burner Schadek wrote:
> The ugly way is to create a @trusted function/lambda that coverts the
> threadId to a string.
>
> Not sure about the pretty way.
thanks a lot. works good enough, just for reference, I added:
string tid2string(Tid id) @trusted {
import std.conv
The ugly way is to create a @trusted function/lambda that coverts
the threadId to a string.
Not sure about the pretty way.
I am experimenting with the logger interface and want to write a custom
logger, that also outputs the threadID or Tid of the LogEntries.
The documentation shows how to do a custom logger, but I am unable to
convert the threadId to a string, because all conversion functions are
not @safe.
Is there
On Thursday, 10 March 2016 at 23:56:14 UTC, ZombineDev wrote:
On Sunday, 6 March 2016 at 09:54:49 UTC, Dsby wrote:
I want to use the filelogger to my application.
is the sharedLog() global and thread-safe.
Yes, `FileLogger` internally uses `lockingTextWriter`, so it
should be safe to call
On Sunday, 6 March 2016 at 09:54:49 UTC, Dsby wrote:
I want to use the filelogger to my application.
is the sharedLog() global and thread-safe.
Yes, `FileLogger` internally uses `lockingTextWriter`, so it
should be safe to call from multiple threads. Furthermore, the
`sharedLog` property u
I want to use the filelogger to my application.
is the sharedLog() global and thread-safe.
Is there a way to include some form of thread-id in the standard
logger log messages without resorting to the use of the 'f'
functions to log this info too?
On Tuesday, 5 January 2016 at 09:18:21 UTC, Robert burner Schadek
wrote:
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test lo
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test log 3");
}
On Tuesday, January 05, 2016 03:01:14 Mike via Digitalmars-d-learn wrote:
> You are right, according to the docs your example should've
> worked just fine. Tried it myself on DMD 2.069.2 and it doesn't
> work either. You should raise an issue on github.
We don't use the issue system on github. We
On Tuesday, 5 January 2016 at 02:59:04 UTC, sanjayss wrote:
On Tuesday, 5 January 2016 at 02:49:01 UTC, Mike wrote:
[...]
Thanks, that works. But the docs are confusing -- it gives the
impression that "sharedLog" is something associated with the
default logger -- so I would expect the above
On Tuesday, 5 January 2016 at 02:49:01 UTC, Mike wrote:
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log
On Tuesday, 5 January 2016 at 02:44:48 UTC, sanjayss wrote:
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test log 3");
I'm doing the following:
import std.experimental.logger;
int
main(string[] args)
{
sharedLog = new FileLogger("logfile.log");
log("Test log 1");
log("Test log 2");
log("Test log 3");
}
and I expected the logs to be seen in the logfile.log, but it
Ah, I tried to format a custom struct that has a non-pure
toString, because std.conv.to isn't pure either, sigh :(
x27;
How do I make formatted logging work?
Would be easier to diagnose your problem if you pasted your code
and uncut complaint from the compiler.
Anyway, the following works, so it may give you a hint:
$ cat log.d
import std.experimental.logger;
void main()
{
logf("just log %s
I tried it on Windows today using the latest DMD installer, all
default logger and settings.
I get: safe function [...].logImplf cannot call system function
'std.format.formattedWrite!(MsgRange, char,
Result!()).formattedWrite'
How do I make formatted logging work?
my guess is that
InitiatingPTrack.toString is not @safe
On 02.09.2015 11:36, Robert burner Schadek wrote:
On Wednesday, 2 September 2015 at 06:57:12 UTC, drug wrote:
Before 2.067 I used std.experimental.logger in form of a dub package.
Because it included in 2.067 I stop using the dub package but now I
get the error:
Error: safe function
On Wednesday, 2 September 2015 at 06:57:12 UTC, drug wrote:
Before 2.067 I used std.experimental.logger in form of a dub
package. Because it included in 2.067 I stop using the dub
package but now I get the error:
Error: safe function
'std.experimental.logger.core.Logger.memLogFunctions
Before 2.067 I used std.experimental.logger in form of a dub package.
Because it included in 2.067 I stop using the dub package but now I get
the error:
Error: safe function
'std.experimental.logger.core.Logger.memLogFunctions!cast(LogLevel)cast(ubyte)32u.logImplf!(383,
[snip]).log
22 matches
Mail list logo