Log system ?? [message #43865] |
Thu, 05 May 2005 01:46  |
Antonio Santiago
Messages: 201 Registered: February 2004
|
Senior Member |
|
|
Hi,
is there any log sytem in IDL ?
I'm programming a little procedure to write information to terminal (or
to a file) with information/error/debug messages, for example:
IDL> logmsg, 'INFO', 'Example message'
that prints:
Thu May 5 10:42:47 2005 - (INFO) - [$MAIN$]: Example message
Exists any good tool for this in IDL.
I'm reading the MESSAGE procedure but it can't write to files, no?
Thanks,
Antonio.
--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
|
|
|
|
Re: Log system ?? [message #86675 is a reply to message #43865] |
Wed, 27 November 2013 11:37   |
spluque
Messages: 33 Registered: September 2013
|
Member |
|
|
I found this old post while searching for a way to log error messages.
I use the MESSAGE procedure quite a lot. In some long procedures, I often use it as:
message, 'Txt', /continue
when I want to report an error of some kind but continue with other operations. I'd like to be able to log these messages to a file, as they are printed in the terminal when they are encountered. It would be nice to have something like a /FILE keyword to MESSAGE, but I suspect there's a reason for its inexistence. Any tips?
Thanks,
Seb
On Thursday, May 5, 2005 3:46:13 AM UTC-5, Antonio Santiago wrote:
> Hi,
> is there any log sytem in IDL ?
>
> I'm programming a little procedure to write information to terminal (or
> to a file) with information/error/debug messages, for example:
>
> IDL> logmsg, 'INFO', 'Example message'
>
> that prints:
>
> Thu May 5 10:42:47 2005 - (INFO) - [$MAIN$]: Example message
>
>
> Exists any good tool for this in IDL.
>
> I'm reading the MESSAGE procedure but it can't write to files, no?
>
> Thanks,
>
> Antonio.
>
>
> --
> -----------------------------------------------------
> Antonio Santiago Pérez
> ( email: santiago<<at>>grahi.upc.edu )
> ( www: http://www.grahi.upc.edu/santiago )
> ( www: http://asantiago.blogsite.org )
> -----------------------------------------------------
> GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
> Universitat Politècnica de Catalunya
> -----------------------------------------------------
|
|
|
Re: Log system ?? [message #86676 is a reply to message #86675] |
Wed, 27 November 2013 11:44   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Sebastian Luque writes:
> I found this old post while searching for a way to log error messages.
>
> I use the MESSAGE procedure quite a lot. In some long procedures, I often use it as:
>
> message, 'Txt', /continue
>
> when I want to report an error of some kind but continue with other operations. I'd like to be able to log these messages to a file, as they are printed in the terminal when they are encountered. It would be nice to have something like a /FILE keyword to MESSAGE, but I suspect there's a reason for its inexistence. Any tips?
http://www.idlcoyote.com/programs/errorlogger__define.pro
There are others. Mike Galloy has one, too.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Log system ?? [message #86729 is a reply to message #86676] |
Fri, 29 November 2013 11:03  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 11/27/13, 12:44 pm, David Fanning wrote:
> Sebastian Luque writes:
>
>> I found this old post while searching for a way to log error messages.
>>
>> I use the MESSAGE procedure quite a lot. In some long procedures, I often use it as:
>>
>> message, 'Txt', /continue
>>
>> when I want to report an error of some kind but continue with other operations. I'd like to be able to log these messages to a file, as they are printed in the terminal when they are encountered. It would be nice to have something like a /FILE keyword to MESSAGE, but I suspect there's a reason for its inexistence. Any tips?
>
> http://www.idlcoyote.com/programs/errorlogger__define.pro
>
> There are others. Mike Galloy has one, too.
>
> Cheers,
>
> David
Here is an article about using my logging system:
http://michaelgalloy.com/2011/11/17/logging.html
Yes, MG_LOG is here:
https://github.com/mgalloy/mglib/blob/master/src/dist_tools/ mg_log.pro
But you need multiple other routines/classes from my library, so I would
just grab the whole thing.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
|
|
|