Re: [Vala] Remove line numbers from logging
- From: san hoi <hoisan49 gmail com>
- To: vala-list gnome org
- Subject: Re: [Vala] Remove line numbers from logging
- Date: Sat, 30 Apr 2011 15:12:55 +0900
hi.
1. make simple custom function.
// https://bugzilla.gnome.org/show_bug.cgi?id=546043
class Test {
static int blah(int test) throws GLib.Error {
if (test > 0)
throw new GLib.Error(GLib.Quark.from_string("test"), 0,
"test error");
return 5;
}
static void something(int val) {
log("value: %d".printf(val));
}
//static void log(string s, string e) { stdout.printf(@"$s $e"); }
static void log(string s) { stdout.printf(@"$s\n"); }
static void main(string[] args) {
log("aaa");
try {
something(blah(-1));
something(blah(1));
} catch(GLib.Error err) {
log("error: %s".printf(err.message));
}
}
}
2. implement logger class. https://launchpad.net/plank
i would be happy to be of any help to you.
Ricardo Gladwell <ricardo gladwell > writes:
Hi Guys
I'm writing some code that uses the GLib log, debug, message etc. static
methods. Is there anyway to disable/remove the pre-pending of file name
and line number to these outputs so that instead of:
[vain] DefaultVainExecution.vala:18: Scanning for projects...
I just print:
[vain] Scanning for projects...
TIA...
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]