stdout

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
freudi_t
Posts: 5
Joined: Fri, 2010-03-12, 09:30

stdout

#1 Post by freudi_t »

I installed StoreScp as Service via srvany. But I didn't get the stdout redirected to a file. I tried a lot of different things but somehow srvany removes my > commands. Is it possible to have a commandline switch that redirect stdout or stderr to a file?
Or does anybody a working AppParameters registry entry for srvany which do the job?

Freudi

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

If you would like to test the current snapshot of the DCMTK, there is another solution (based on the new unified logging mechanism -- see Howto: Output all log messages to a file).

freudi_t
Posts: 5
Joined: Fri, 2010-03-12, 09:30

#3 Post by freudi_t »

Sounds great. I will try that. Thanks

freudi_t
Posts: 5
Joined: Fri, 2010-03-12, 09:30

stdout

#4 Post by freudi_t »

Wow ! At first I want to pay a compliment. I downloaded snapshot, cmake and after 10 minutes I have a functioning storescp. Great. BTW I use VS2008.
Now I can use the new commandline switch that you suggest. And it is working, buuut because it is service I want all stdout messages in that file. In the case that a directory don't exist or don't exists anymore, these messages still go out to the DOS-Window not to the file. Example:
storescp had command line switch -od "C:\tmp"
If start it as a service and c:\tmp didn't exist I got no msg in the logfile.
The results of commandline parsing should go to the logfile, too.
Now I have the sources :-). Do you have any hint where and how to include that?

Freudi

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#5 Post by Jörg Riesmeier »

Something like the following should work:

Code: Select all

diff -r1.122 storescp.cc
1006c1006,1009
<       app.printError("specified output directory does not exist");
---
>     {
>       OFLOG_FATAL(storescpLogger, "specified output directory does not exist");
>       return 1;
>     }
1011c1014,1017
<     app.printError("specified output directory is not writeable");
---
>   {
>     OFLOG_FATAL(storescpLogger, "specified output directory is not writeable");
>     return 1;
>   }
Regarding the use of the logger output for command line tools see the following Wiki page.

freudi_t
Posts: 5
Joined: Fri, 2010-03-12, 09:30

#6 Post by freudi_t »

Super! Problem solved.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest