Re: [Vala] How to receive error message which vala's compiler output.



On Thu, Mar 24, 2011 at 11:01:24AM +0900, san hoi wrote:
Sorry for sending next one more question to  list.
I try to receive error message which vala's compiler output.

f=file("data.out", "w")
cmd = "valac -v hello.vala"
p=subprocess.Popen(cmd, shell=True, stdout=f, stderr=subprocess.PIPE)
errcode=p.wait()
f.close()
for line in file("data.out"):
...   print(line)
...
Compilation failed: 1 error(s), 0 warning(s)  <--- valac -v return
this oneline message.

f=file("data.out", "w")
cmd = "valac -q hello.vala"
p=subprocess.Popen(cmd, shell=True, stdout=f, stderr=subprocess.PIPE)
errcode=p.wait()
f.close()
for line in file("data.out"):
...   print(line)
                                                              <---
valac -q  no return message.

However I can receive only an oneline message...
Next, I try to redirect message to file.

valac's case :

[mymas localhost Downloads]$ valac hello.vala > redirect.out
hello.vala:1.25-1.35: error: The type name `GLib.object' could not be found
class Demo.HelloWorld : GLib.object {
                        ^^^^^^^^^^^
[mymas localhost Downloads]$ cat redirect.out
Compilation failed: 1 error(s), 0 warning(s) <--- valac return this
oneline message.

python's case :

[mymas localhost Downloads]$ python hello.vala > redirect.out
  File "hello.vala", line 1
    class Demo.HelloWorld : GLib.object {
              ^
SyntaxError: invalid syntax
[mymas localhost Downloads]$ cat redirect.out
                                                              <---
umm...python no return message.

As a result, is not work.

Question. Is there way to receive that valac's full multiline error message?
Regards.

Errors are outputted in stderr, you're only redirecting stdout.

-- 
http://www.debian.org - The Universal Operating System

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]