www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Question about dsfml.system.err

reply Konstantin Kutsevalov <adamasantares gmail.com> writes:
I need to see errors from dsfml.system.err, but it doesn't write 
to terminal as I expected.

The general problem is that I cannot listen any port by 
tcplistener. And listen method is:

	Status accept(TcpSocket socket)
	{
		import dsfml.system.string;
		Status toReturn = sfTcpListener_accept(sfPtr, socket.sfPtr);
		err.write(dsfml.system.string.toString(sfErr_getOutput()));
		return toReturn;
	}

so, as you can see, there is "err.write". I need to see which 
error is wrining ro "err"...
Is it possible to redeclate "err" File() object?

:(
Nov 08 2016
parent reply Konstantin Kutsevalov <adamasantares gmail.com> writes:
ADD:

I tried to open other stream in main()

```
...
import dsfml.system.err;

int main(string[] args)
{
	err.open("errors.log", "a");
	err.write("test\n");
     ....
}
...
```

but as can I see, that hasn't any effect for tcplistener module...
Nov 08 2016
parent reply Konstantin Kutsevalov <adamasantares gmail.com> writes:
On Tuesday, 8 November 2016 at 16:34:04 UTC, Konstantin 
Kutsevalov wrote:
 ADD:

 I tried to open other stream in main()

 ```
 ...
 import dsfml.system.err;

 int main(string[] args)
 {
 	err.open("errors.log", "a");
 	err.write("test\n");
     ....
 }
 ...
 ```

 but as can I see, that hasn't any effect for tcplistener 
 module...
OK ... problem with tcplistener solved, just a code mistake. But the question is actual.
Nov 08 2016
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 11/8/16 11:48 AM, Konstantin Kutsevalov wrote:
 On Tuesday, 8 November 2016 at 16:34:04 UTC, Konstantin Kutsevalov wrote:
 ADD:

 I tried to open other stream in main()

 ```
 ...
 import dsfml.system.err;

 int main(string[] args)
 {
     err.open("errors.log", "a");
     err.write("test\n");
     ....
 }
 ...
 ```

 but as can I see, that hasn't any effect for tcplistener module...
OK ... problem with tcplistener solved, just a code mistake. But the question is actual.
I can honestly say, I don't know what dsfml is or any of the code you have posted. -Steve
Nov 08 2016
parent Konstantin Kutsevalov <adamasantares gmail.com> writes:
On Tuesday, 8 November 2016 at 19:00:15 UTC, Steven Schveighoffer 
wrote:
 On 11/8/16 11:48 AM, Konstantin Kutsevalov wrote:
 On Tuesday, 8 November 2016 at 16:34:04 UTC, Konstantin 
 Kutsevalov wrote:
 ADD:

 I tried to open other stream in main()

 ```
 ...
 import dsfml.system.err;

 int main(string[] args)
 {
     err.open("errors.log", "a");
     err.write("test\n");
     ....
 }
 ...
 ```

 but as can I see, that hasn't any effect for tcplistener 
 module...
OK ... problem with tcplistener solved, just a code mistake. But the question is actual.
I can honestly say, I don't know what dsfml is or any of the code you have posted. -Steve
oh, it's ok because it's all work fine, I just was too inattentive.
Nov 08 2016