Re: [Vala] Remove line numbers from logging



On Fri, 2011-04-29 at 12:57 -0400, Jonathan Ryan wrote:
On Fri, 29 Apr 2011 16:39:58 +0100, Ricardo Gladwell wrote:
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...

 Set a custom logger handler. 
 http://developer.gnome.org/glib/unstable/glib-Message-Logging.html
 http://valadoc.org/references/glib-2.0/0.11.5/GLib.Log.html

Hi Jonathan,thanks for the feedback. I am setting a custom log handler:

        Log.set_default_handler(vain_log_function);

But it looks as though valac is compiling the file name and line number
right into the C code:

        #line 17 "DefaultVainExecution.vala"
        g_log ("Vain", G_LOG_LEVEL_INFO, "DefaultVainExecution.vala:17:
Scanning for projects...");

TIA...


-- 
Ricardo Gladwell <ricardo gladwell gmail com>
http://www.google.com/profiles/ricardo.gladwell
Twitter: @rgladwell - MSN: axonrg gmail com




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