comp.lang.ada
 help / color / mirror / Atom feed
* Understanding Visibility
@ 2012-09-17 20:42 tonyg
  2012-09-17 21:19 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: tonyg @ 2012-09-17 20:42 UTC (permalink / raw)



I needed to log some stuff from several tasks in one program. So I wrote a little logging package. I used a package containing several text_io.file_types followed by a protected object to make sure the file operations were not interfered with. 
    However when things were passed through to inside the protected object I found that the file was not taking the information being passed to it. Can anyone explain this to me, as I think the file should be visible. 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-17 20:42 Understanding Visibility tonyg
@ 2012-09-17 21:19 ` Dmitry A. Kazakov
  2012-09-18  6:36 ` Thomas Løcke
  2012-09-18  7:52 ` tonyg
  2 siblings, 0 replies; 9+ messages in thread
From: Dmitry A. Kazakov @ 2012-09-17 21:19 UTC (permalink / raw)


On Mon, 17 Sep 2012 13:42:27 -0700 (PDT), tonyg wrote:

> I needed to log some stuff from several tasks in one program. So I wrote a
> little logging package. I used a package containing several
> text_io.file_types followed by a protected object to make sure the file
> operations were not interfered with. 

It is an error to do I/O from a protected action, since I/O is a
potentially blocking operation.

You should either use a task (AKA monitor) or else a protected object
implementing a mutex (using a controlled holder object, of course).

> However when things were passed through to inside the protected object I
> found that the file was not taking the information being passed to it. Can
> anyone explain this to me, as I think the file should be visible.

You should always post a working code illustrating the problem.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-17 20:42 Understanding Visibility tonyg
  2012-09-17 21:19 ` Dmitry A. Kazakov
@ 2012-09-18  6:36 ` Thomas Løcke
  2012-09-18 13:47   ` tonyg
  2012-09-18  7:52 ` tonyg
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Løcke @ 2012-09-18  6:36 UTC (permalink / raw)


On 09/17/2012 10:42 PM, tonyg wrote:
>
> I needed to log some stuff from several tasks in one program. So I wrote a little logging package. I used a package containing several text_io.file_types followed by a protected object to make sure the file operations were not interfered with.
>      However when things were passed through to inside the protected object I found that the file was not taking the information being passed to it. Can anyone explain this to me, as I think the file should be visible.
>


You could take a peek at how they solved the problem in the GNATCOLL
package, specifically the Traces part:

http://docs.adacore.com/gnatcoll-docs/traces.html

It works flawlessly, or rather I've not been able to trash it yet. :D

Another option is Alog from codelabs:  http://www.codelabs.ch/alog/

And a third one is grabbing AWS and look at their AWS.Log package.

Lots of good stuff to learn from.

Personally I use GNATCOLL.Traces for most of my logging needs, as it
can log to syslogd, which I find very handy.

-- 
Thomas L�cke | thomas@12boo.net | http://12boo.net



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-17 20:42 Understanding Visibility tonyg
  2012-09-17 21:19 ` Dmitry A. Kazakov
  2012-09-18  6:36 ` Thomas Løcke
@ 2012-09-18  7:52 ` tonyg
  2 siblings, 0 replies; 9+ messages in thread
From: tonyg @ 2012-09-18  7:52 UTC (permalink / raw)


On Monday, 17 September 2012 21:42:28 UTC+1, tonyg  wrote:
> I needed to log some stuff from several tasks in one program. So I wrote a little logging package. I used a package containing several text_io.file_types followed by a protected object to make sure the file operations were not interfered with. 
> 
>     However when things were passed through to inside the protected object I found that the file was not taking the information being passed to it. Can anyone explain this to me, as I think the file should be visible.

Thanks Guys, point taken Dmitry, I'll take a look at Traces Thomas.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-18  6:36 ` Thomas Løcke
@ 2012-09-18 13:47   ` tonyg
  2012-09-18 14:00     ` tonyg
  2012-09-18 15:17     ` Understanding Visibility xavier grave
  0 siblings, 2 replies; 9+ messages in thread
From: tonyg @ 2012-09-18 13:47 UTC (permalink / raw)


On Tuesday, 18 September 2012 07:36:45 UTC+1, Thomas Løcke  wrote:
> On 09/17/2012 10:42 PM, tonyg wrote:
> 
> >
> 
> > I needed to log some stuff from several tasks in one program. So I wrote a little logging package. I used a package containing several text_io.file_types followed by a protected object to make sure the file operations were not interfered with.
> 
> >      However when things were passed through to inside the protected object I found that the file was not taking the information being passed to it. Can anyone explain this to me, as I think the file should be visible.
> 
> >
> 
> 
> 
> 
> 
> You could take a peek at how they solved the problem in the GNATCOLL
> 
> package, specifically the Traces part:
> 
> 
> 
> http://docs.adacore.com/gnatcoll-docs/traces.html
> 
> 
> 
> It works flawlessly, or rather I've not been able to trash it yet. :D
> 
> 
> 
> Another option is Alog from codelabs:  http://www.codelabs.ch/alog/
> 
> 
> 
> And a third one is grabbing AWS and look at their AWS.Log package.
> 
> 
> 
> Lots of good stuff to learn from.
> 
> 
> 
> Personally I use GNATCOLL.Traces for most of my logging needs, as it
> 
> can log to syslogd, which I find very handy.
> 
> 
> 
> -- 
> 
> Thomas Løcke | thomas@12boo.net | http://12boo.net

I noticed that alog has debian wheezy packages supported \o/ so I am taking a good long look at that rather than gnatcoll which needs to be installed from source. Its looking good so far.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-18 13:47   ` tonyg
@ 2012-09-18 14:00     ` tonyg
  2012-09-18 14:36       ` Thomas Løcke
  2012-09-19  1:32       ` netiquette Stephen Leake
  2012-09-18 15:17     ` Understanding Visibility xavier grave
  1 sibling, 2 replies; 9+ messages in thread
From: tonyg @ 2012-09-18 14:00 UTC (permalink / raw)


On Tuesday, 18 September 2012 14:47:03 UTC+1, tonyg  wrote:
> On Tuesday, 18 September 2012 07:36:45 UTC+1, Thomas Løcke  wrote:
> 
> > On 09/17/2012 10:42 PM, tonyg wrote:
> 
> > 
> 
> > >
> 
> > 
> 
> > > I needed to log some stuff from several tasks in one program. So I wrote a little logging package. I used a package containing several text_io.file_types followed by a protected object to make sure the file operations were not interfered with.
> 
> > 
> 
> > >      However when things were passed through to inside the protected object I found that the file was not taking the information being passed to it. Can anyone explain this to me, as I think the file should be visible.
> 
> > 
> 
> > >
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > You could take a peek at how they solved the problem in the GNATCOLL
> 
> > 
> 
> > package, specifically the Traces part:
> 
> > 
> 
> > 
> 
> > 
> 
> > http://docs.adacore.com/gnatcoll-docs/traces.html
> 
> > 
> 
> > 
> 
> > 
> 
> > It works flawlessly, or rather I've not been able to trash it yet. :D
> 
> > 
> 
> > 
> 
> > 
> 
> > Another option is Alog from codelabs:  http://www.codelabs.ch/alog/
> 
> > 
> 
> > 
> 
> > 
> 
> > And a third one is grabbing AWS and look at their AWS.Log package.
> 
> > 
> 
> > 
> 
> > 
> 
> > Lots of good stuff to learn from.
> 
> > 
> 
> > 
> 
> > 
> 
> > Personally I use GNATCOLL.Traces for most of my logging needs, as it
> 
> > 
> 
> > can log to syslogd, which I find very handy.
> 
> > 
> 
> > 
> 
> > 
> 
> > -- 
> 
> > 
> 
> > Thomas Løcke | thomas@12boo.net | http://12boo.net
> 
> 
> 
> I noticed that alog has debian wheezy packages supported \o/ so I am taking a good long look at that rather than gnatcoll which needs to be installed from source. Its looking good so far.

Did you know that alog can also post to syslog?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-18 14:00     ` tonyg
@ 2012-09-18 14:36       ` Thomas Løcke
  2012-09-19  1:32       ` netiquette Stephen Leake
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Løcke @ 2012-09-18 14:36 UTC (permalink / raw)


On 09/18/2012 04:00 PM, tonyg wrote:
>
> Did you know that alog can also post to syslog?
>


Yea, but since I'm using GNATColl rather extensively, I saw no need
to add another dependency to my projects.

-- 
Thomas L�cke | thomas@12boo.net | http://12boo.net



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Understanding Visibility
  2012-09-18 13:47   ` tonyg
  2012-09-18 14:00     ` tonyg
@ 2012-09-18 15:17     ` xavier grave
  1 sibling, 0 replies; 9+ messages in thread
From: xavier grave @ 2012-09-18 15:17 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 18/09/2012 15:47, tonyg a �crit :
> On Tuesday, 18 September 2012 07:36:45 UTC+1, Thomas L�cke  wrote:
>> On 09/17/2012 10:42 PM, tonyg wrote:
>>
>>>
>>
>>> I needed to log some stuff from several tasks in one program. So I wrote a little logging package. I used a package containing several text_io.file_types followed by a protected object to make sure the file operations were not interfered with.
>>
>>>      However when things were passed through to inside the protected object I found that the file was not taking the information being passed to it. Can anyone explain this to me, as I think the file should be visible.
>>
>>>
>>
>>
>>
>>
>>
>> You could take a peek at how they solved the problem in the GNATCOLL
>>
>> package, specifically the Traces part:
>>
>>
>>
>> http://docs.adacore.com/gnatcoll-docs/traces.html
>>
>>
>>
>> It works flawlessly, or rather I've not been able to trash it yet. :D
>>
>>
>>
>> Another option is Alog from codelabs:  http://www.codelabs.ch/alog/
>>
>>
>>
>> And a third one is grabbing AWS and look at their AWS.Log package.
>>
>>
>>
>> Lots of good stuff to learn from.
>>
>>
>>
>> Personally I use GNATCOLL.Traces for most of my logging needs, as it
>>
>> can log to syslogd, which I find very handy.
>>
>>
>>
>> -- 
>>
>> Thomas L�cke | thomas@12boo.net | http://12boo.net
> 
> I noticed that alog has debian wheezy packages supported \o/ so I am taking a good long look at that rather than gnatcoll which needs to be installed from source. Its looking good so far.

If communication with log4j (or chainsaw) is an option you can have a
look at log4ada, which is also packaged in Debian.

But it can't log to syslog, except if you have time to provide/code an
appender that enable you to do it :)

xavier grave
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBYkHMACgkQVIZi0A5BZF5pUgCfXwK6uvLWba88QfUKIjy//1ck
nMQAnjIfi7SCUIw2KijxZe64/DJevLh6
=2OlC
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: netiquette
  2012-09-18 14:00     ` tonyg
  2012-09-18 14:36       ` Thomas Løcke
@ 2012-09-19  1:32       ` Stephen Leake
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Leake @ 2012-09-19  1:32 UTC (permalink / raw)


tonyg <tonythegair@gmail.com> writes:

> Did you know that alog can also post to syslog?

You really should trim posts; scrolling thru 100 lines of quoted text to
find this is _really_ annoying!

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-09-21  1:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 20:42 Understanding Visibility tonyg
2012-09-17 21:19 ` Dmitry A. Kazakov
2012-09-18  6:36 ` Thomas Løcke
2012-09-18 13:47   ` tonyg
2012-09-18 14:00     ` tonyg
2012-09-18 14:36       ` Thomas Løcke
2012-09-19  1:32       ` netiquette Stephen Leake
2012-09-18 15:17     ` Understanding Visibility xavier grave
2012-09-18  7:52 ` tonyg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox