Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Logging (-0) removed in Csound 5?

Date2005-09-22 15:14
FromMichael Gogins
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
In my view, the decision to remove logging was correct. It should always be possible to redirect stderr and/or stdout to a file. This is a standard practice with many programs on all platforms.

What are the objections to this maintenance-free and effective solution?

Regards,
Mike

-----Original Message-----
From: Istvan Varga 
Sent: Sep 22, 2005 4:27 AM
To: csound@lists.bath.ac.uk
Subject: Re: [Csnd] Logging (-0) removed in Csound 5?

Anthony Kozar wrote:

> What?  Why was this removed?

It was probably related to the replacement of dribble_printf, err_printf,
and whatever was used in Csound 4 with the API functions. The standard
command line frontend could easily implement logging by replacing the
default message callback; this would need some command line parsing done
in the frontend, though, which is ugly. A more complete solution of having
the logging implemented in libcsound itself is actually not as easy as I
thought, because many messages are already printed by the time the command
line flags are parsed; so, either those messages will be lost, or even
more ugly hacks are needed to save the initial messages to a (dynamically
increased) temporary buffer first which will eventually be freed.
-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk



-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-22 16:07
FromDavid Akbari
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
On Sep 22, 2005, at 10:14 AM, Michael Gogins wrote:

> It should always be possible to redirect stderr and/or stdout to a 
> file. This is a standard practice with many programs on all platforms.
>

You know, it's funny you mention that.

For example, if I try doing

[localhost:~] ls -a > list.txt

I get the directory contents in a text file, as expected. However if I 
do

[localhost:~/csoundpath] ./csound -z1 > cs_opcodes.txt

Csound5 (Sept 21 2005) outputs a blank text file with the opcode list 
to the console window.

Is this as expected? Ideally I would want the information to just go 
straight to the text file and not ever appear in the Terminal window. 
Of course it is no problem to copy / paste the output but it is one 
more potentially time saving step ...


-David

-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-22 16:13
FromSteven Yi
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
AttachmentsNone  

Date2005-09-22 16:20
FromIstvan Varga
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
David Akbari wrote:

> [localhost:~] ls -a > list.txt
> 
> I get the directory contents in a text file, as expected. However if I do
> 
> [localhost:~/csoundpath] ./csound -z1 > cs_opcodes.txt
> 
> Csound5 (Sept 21 2005) outputs a blank text file with the opcode list to 
> the console window.

Now try

[localhost:~/csoundpath] ./csound -z1 2> cs_opcodes.txt

However, I do have logging implemented in my (not yet committed) sources,
so you may expect that feature to return eventually; of course, unless
everyone agrees to remove logging completely.
-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-22 16:40
FromDavid Akbari
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
On Sep 22, 2005, at 11:13 AM, Steven Yi wrote:

> You might need to do:
>
> csound -z1 &> cs_opcodes.txt
>
> as I think csound prints to stderr.
>
> steven
>
>

In a tcsh shell it returns:

tcsh: Invalid null command.

but it works as expected in a bash shell.

On Sep 22, 2005, at 11:20 AM, Istvan Varga wrote:

> Now try
>
> [localhost:~/csoundpath] ./csound -z1 2> cs_opcodes.txt
>

Again, this works in a bash shell but not in tcsh. It is more elegant 
in that it does not return an error in tcsh but just outputs to stdout.

> so you may expect that feature to return eventually; of course, unless
> everyone agrees to remove logging completely.

For the most part I agree with Michael Gogins' suggestion of preferring 
to use the OS's redirect file output syntax, however on Mac OS9 for 
example there is no console, so unless Csound explicitly outputs the 
strings it would print to stdout to a file, it would be impossible to 
get a log (of course some AppleScript could likely do the trick...). 
Likely some flavours of BSD would be affected as well, where this type 
of redirection may not be possible.

However to reiterate I would think it would be a wiser choice to 
sacrifice the feature over having to re-write sections of the API, as 
Windows, OSX, and most *nix can do this type of stdout redirection. In 
large part I couldn't agree more with the following statement.

On Sep 22, 2005, at 11:36 AM, Michael Gogins wrote:

> I think Csound should focus its development effort on music unless 
> absolutely required to do something else.


Just my humble opinion.


-David

-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-22 17:23
FromAnthony Kozar
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
Michael Gogins wrote on 9/22/05 10:14 AM:

> In my view, the decision to remove logging was correct. It should always be
> possible to redirect stderr and/or stdout to a file. This is a standard
> practice with many programs on all platforms.

This is incorrect.  Not all platforms have Unix-like facilities or even
command-line interfaces!  MacOS 9 does not allow the redirecting of stderr
and stdout as it does not really have these concepts.  Other platforms that
Csound has run on in the past have also lacked these capabilities.  And I
would expect that there will be future platforms that people will want to
use Csound on that also lack them (handhelds, maybe even cell phones, or
something completely different).

> What are the objections to this maintenance-free and effective solution?

We cannot assume a Unix environment.  But we have to assume a standard C
library including  for other reasons.  Any platform which has that
will support CsoundLib logging its messages to a file.  So, I think
including some logging capability in the library is a better solution.

Anthony Kozar
anthonykozar@sbcglobal.net
http://akozar.spymac.net/

-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2005-09-22 17:37
FromAnthony Kozar
SubjectRe: [Csnd] Logging (-0) removed in Csound 5?
> What are the objections to this maintenance-free and effective solution?

The other thing that is useful about -O for logging messages is that you can
put it in your  or your .csoundrc file to ensure that every run
of Csound logs its messages.  Then you do not have to remember to do so, and
can conveniently look at the messages after losing them on-screen.

This is what I currently do (I have -Omessages in my .csoundrc) and it has
made it possible for me to avoid rerunning Csound numerous times to check on
something that I forgot to look for initially.  (Or could not see on screen
due to the console window's 32K text limit on MacOS 9).

Anthony Kozar
anthonykozar AT sbcglobal DOT net
http://akozar.spymac.net/

-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk