Logging Facility for Octave

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging Facility for Octave

phofman
Hi,

Please is there any logging facility for octave? The error/warning
functions have a deeper behavior, I am just looking for a configurable
facility issuing text strings to stderr/stdout/logfile with timestamp,
scriptname etc. - some simple form of log4j etc.

I can write my own octave methods but perhaps there is a
performance-optimised package or some best practice.

Thanks a log for any help.

Best regards,

Pavel.


Reply | Threaded
Open this post in threaded view
|

Re: Logging Facility for Octave

apjanke-floss

On 1/4/19 2:22 PM, Pavel Hofman wrote:

> Hi,
>
> Please is there any logging facility for octave? The error/warning
> functions have a deeper behavior, I am just looking for a configurable
> facility issuing text strings to stderr/stdout/logfile with timestamp,
> scriptname etc. - some simple form of log4j etc.
>
> I can write my own octave methods but perhaps there is a
> performance-optimised package or some best practice.
>
> Thanks a log for any help.
>
> Best regards,
>
> Pavel.
>

For logging in Matlab, I actually use an M-code wrapper layer that sits
on top of log4j + SLF4J and presents an M-code interface for it (with
short-circuiting for performance) and a little configurator GUI. That
way you get all the features of log4j/SLF4J, and any Java code or
libraries you use in your application can go through the same logging
mechanism so it can be configured at a single point.

https://github.com/apjanke/SLF4M

(Background - I've used logging layers like this in enterprise Matlab
systems, so I'm confident it's a decent approach.)

It wouldn't be too hard to port this to Octave. Or if Java dot-reference
support were added to Octave (https://savannah.gnu.org/bugs/?48428), it
should just work as is.

There are a couple other logging packages on MathWorks File Exchange
that use pure M-code, and might work as is in Octave, too.

https://www.mathworks.com/matlabcentral/fileexchange/?utf8=%E2%9C%93&term=logging

I wouldn't worry about performance optimization too much; the main thing
to worry about is keeping your logging calls out of tight loops.

Cheers,
Andrew


Reply | Threaded
Open this post in threaded view
|

Re: Logging Facility for Octave

phofman
>
> For logging in Matlab, I actually use an M-code wrapper layer that sits
> on top of log4j + SLF4J and presents an M-code interface for it (with
> short-circuiting for performance) and a little configurator GUI. That
> way you get all the features of log4j/SLF4J, and any Java code or
> libraries you use in your application can go through the same logging
> mechanism so it can be configured at a single point.
>
> https://github.com/apjanke/SLF4M
>
> (Background - I've used logging layers like this in enterprise Matlab
> systems, so I'm confident it's a decent approach.)
>
> It wouldn't be too hard to port this to Octave. Or if Java dot-reference
> support were added to Octave (https://savannah.gnu.org/bugs/?48428), it
> should just work as is.
>
> There are a couple other logging packages on MathWorks File Exchange
> that use pure M-code, and might work as is in Octave, too.
>
> https://www.mathworks.com/matlabcentral/fileexchange/?utf8=%E2%9C%93&term=logging 
>
>
> I wouldn't worry about performance optimization too much; the main thing
> to worry about is keeping your logging calls out of tight loops.
>
> Cheers,
> Andrew

Hi Andrew,

Thanks a log for your hints. I was searching google for octave as a
keyword and that did not return any results. Searching for matlab did
not come to my mind, my fault. The link with matlab logging projects is
great.

Many thanks and best regards,

Pavel.