[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[equinox-dev] Safe logging from a WeavingHook?
- From: Stephan Herrmann <stephan.herrmann@xxxxxxxxx>
- Date: Sun, 15 May 2016 14:03:49 +0200
- Delivered-to: firstname.lastname@example.org
- User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
When implementing a WeavingHook, is there a safe way to perform logging?
I'm asking because my current strategy recently broke when adding
the AERI error reporter to the mix:
I'm acquiring a log basically from
(with extra caution to see if the platform is ready).
This works well until others register log listeners of their own.
Such breakage is tracked in https://bugs.eclipse.org/493566
showing a stack trace of what looks like deadly re-entrance,
I know that the Equinox framework uses a logger of its own,
which - I assume - does not support any log listeners, right?
Is it possible for a weaving hook implementation to log into
the framework log?
If no safe log is available, are there any points in the hook
protocol, where it is safe to log using a platform log?
I'm thinking of queueing log events until modified(WovenClass),
but even during that method I don't know if any class loading
is active further down the stack that may cause the same problem.
Do I have to maintain my own thread-local stack of classes
being defined to wait for a point when this stack is empty?
Or is it possible to get this information from the framework?
Interesting, how such a basic functionality like logging can blow
up a system, if both class loading and logging are extensible ...