Re: Would a logging framework make sense for PicoLisp

2014-04-12 Thread Henrik Sarvell
I'm glad they helped you. Just fixed a bug or two, I had to Google to find out how to always display the newest version on Bitbucket so finally, here is the link: https://bitbucket.org/hsarvell/ext/src/tip/log.l?at=default Apparently one has to replace the revision hash with tip. On Sat, Apr

Re: Would a logging framework make sense for PicoLisp

2014-04-11 Thread Henrik Sarvell
Hi Andreas, can I put this in my ext lib: https://bitbucket.org/hsarvell/ext? I will of course keep the head with your email and info etc. On Mon, Mar 10, 2014 at 6:06 PM, Thorsten Jolitz tjol...@gmail.com wrote: andr...@itship.ch writes: Hi Andreas, I'm not sure if I understand you

Re: Would a logging framework make sense for PicoLisp

2014-04-11 Thread Henrik Sarvell
I feel like I have changed the original now to such an extent that I don't have to ask anymore :-) It feels like a derivative work. However, attribution is kept in the source: https://bitbucket.org/hsarvell/ext/raw/b2516583e54a97c0e903dcb5b63b0b3cb8c1934a/log.l And here:

Re: Would a logging framework make sense for PicoLisp

2014-04-11 Thread Jakob Eriksson
If it is derivative, you should ask. On April 11, 2014 7:07:25 PM CEST, Henrik Sarvell hsarv...@gmail.com wrote: I feel like I have changed the original now to such an extent that I don't have to ask anymore :-) It feels like a derivative work. However, attribution is kept in the source:

Re: Would a logging framework make sense for PicoLisp

2014-04-11 Thread Henrik Sarvell
Sorry Jakob, I should have been more clear, derivative work with enough transformativeness is fair use: http://en.wikipedia.org/wiki/Transformativeness It seems that the earlier raw link was to that specific revision, this is better I hope:

Re: Would a logging framework make sense for PicoLisp

2014-04-11 Thread andreas
Hi guys Hi Andreas, can I put this in my ext lib: https://bitbucket.org/hsarvell/ext ? I will of course keep the head with your email and info etc Yes surely, I feel honored. Thank you for asking! By the way, let me thank you for your database tutorials on your blog, they helped a lot in the

Re: Would a logging framework make sense for PicoLisp

2014-04-11 Thread Alexander Burger
Hi Andreas, On Fri, Apr 11, 2014 at 08:33:22PM -, andr...@itship.ch wrote: Nice, thanks for the nice namespace example. Will introduce namespaces to my code now. Side question: Can namespaces be nested? e.g. lib~sublib~symbol? Yes. ♪♫ Alex -- UNSUBSCRIBE:

Re: Would a logging framework make sense for PicoLisp

2014-03-10 Thread Thorsten Jolitz
andr...@itship.ch writes: Hi Andreas, I crafted a tiny logging tool consisting of one function and some globals. I'm new to picolisp (and its my first lisp), so feedback and advices are greatly appreciated. great, thank you, I just did a quick first test and it worked:

Re: Would a logging framework make sense for PicoLisp

2014-03-10 Thread Thorsten Jolitz
Thorsten Jolitz tjol...@gmail.com writes: andr...@itship.ch writes: Hi Andreas, I crafted a tiny logging tool consisting of one function and some globals. I'm new to picolisp (and its my first lisp), so feedback and advices are greatly appreciated. great, thank you, I just did a quick

Re: Would a logging framework make sense for PicoLisp

2014-03-10 Thread andreas
Hi Thorsten I'm not sure if I understand you correctly. You can use (log) in different ways, e.g.: (log just a message) (log 'debug variable x is x) (log 'warn folder size is reaching 1GB) (log 'error a fatal error occured) If (on *LogOn), all messages get printed. If (setq *LogOn 'warn), only

Re: Would a logging framework make sense for PicoLisp

2014-03-10 Thread Thorsten Jolitz
andr...@itship.ch writes: Hi Andreas, I'm not sure if I understand you correctly. You can use (log) in different ways, e.g.: (log just a message) (log 'debug variable x is x) (log 'warn folder size is reaching 1GB) (log 'error a fatal error occured) If (on *LogOn), all messages get

Re: Would a logging framework make sense for PicoLisp

2014-03-09 Thread andreas
Hi List I crafted a tiny logging tool consisting of one function and some globals. I'm new to picolisp (and its my first lisp), so feedback and advices are greatly appreciated. The thing is mainly meant for debugging or logging in server apps. Code: http://beneroth.ch/pil/log.l Features: -

Re: Would a logging framework make sense for PicoLisp

2014-02-27 Thread Alexander Burger
Hi Thorsten, but it would be nice to have a function pair (log and unlog) that does all this: - trace the function - redirect the output of trace to a file too - untrace and go back to default stderr something like this #+begin_src picolisp (de log (Func) (err (tmp log)

Re: Would a logging framework make sense for PicoLisp

2014-02-27 Thread Thorsten Jolitz
Alexander Burger a...@software-lab.de writes: Hi Alex, How about this? (de log (File Funs . Prg) (err File (prog2 (mapc trace Funs) (run Prg 1) (mapc untrace Funs) ) ) ) It can be used like (log +myLogFile '(gt0 le0 + - * /)

Re: Would a logging framework make sense for PicoLisp

2014-02-27 Thread Alexander Burger
Hi Thorsten, could it be used to optionally log a whole web-application by wrapping the main function as 'myProgram' into the log function? (de main () (call 'mkdir -p *Pool *Blob) (pool *Pool *Dbs *Jnl) (unless (seq *DB) (load app/init.l) ) ... ) (de logMain ()

Re: Would a logging framework make sense for PicoLisp

2014-02-25 Thread Henrik Sarvell
Sometimes it's also nice to be able to get everything in a file, not just printed, would be nice if it could have that option. On Tue, Feb 25, 2014 at 6:50 PM, Thorsten Jolitz tjol...@gmail.com wrote: Hi List, sometimes I start putting a lot of (maybe too many) 'msg calls in my code for

Re: Would a logging framework make sense for PicoLisp

2014-02-25 Thread Joe Bogner
I like the idea of something simple and possibly built-in. However, would it be possible to implement as a function that wraps definitions with a redef and adds the logging? http://software-lab.de/doc/refR.html#redef On Tue, Feb 25, 2014 at 9:20 AM, Henrik Sarvell hsarv...@gmail.com wrote:

Re: Would a logging framework make sense for PicoLisp

2014-02-25 Thread Henrik Sarvell
Yes AFAIK all of Thorsten's description should be possible to implement without touching any code that needs to be compiled. So code away, no need to ask Alex for anything! ;-) On Tue, Feb 25, 2014 at 9:35 PM, Joe Bogner joebog...@gmail.com wrote: I like the idea of something simple and possibly

Re: Would a logging framework make sense for PicoLisp

2014-02-25 Thread Alexander Burger
On Tue, Feb 25, 2014 at 09:35:05AM -0500, Joe Bogner wrote: I like the idea of something simple and possibly built-in. However, would it be possible to implement as a function that wraps definitions with a redef and adds the logging? This might possibly done with 'daemon'. Not really a wrap,

Re: Would a logging framework make sense for PicoLisp

2014-02-25 Thread Alexander Burger
On Tue, Feb 25, 2014 at 05:01:21PM +0100, Alexander Burger wrote: One simple way is to use 'err' around your program to redirect standard error (err myLog.txt (main) ) and then use the normal 'trace' and 'msg' functions which print to standard error. or, of course, start the

Re: Would a logging framework make sense for PicoLisp

2014-02-25 Thread Thorsten Jolitz
Alexander Burger a...@software-lab.de writes: On Tue, Feb 25, 2014 at 05:01:21PM +0100, Alexander Burger wrote: One simple way is to use 'err' around your program to redirect standard error (err myLog.txt (main) ) and then use the normal 'trace' and 'msg' functions which print