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



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.



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