entrusc / slf4j-osgi Goto Github PK
View Code? Open in Web Editor NEWOSGi Logging Framework adapter for SLF4J
OSGi Logging Framework adapter for SLF4J
It's possible if a LogService bundle is swapped that in the typical usage of a slf4j logger, the logging for the class may stop working until the bundle is restarted. Below would be the example
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MyClass {
private Logger logger = LoggerFactory.getLogger(MyClass.class);
public void doSomething() {
logger.trace("MyClass.doSomething");
}
}
As you can see, there's a single call to the LoggerFactory which will return the instance available at that point. Assuming there is a LogService available, the value will be initialized to the current OSGiLogger. If the LogService goes away an EmptyLogger will be set as the current Logger in the LogFactory, but that won't update the references to the OSGiLogger that all the classes which asked the LogFactory have. The original implementation that this one is based on always returned the same log factory and within that log factory handled the change.
To update this version, a similar mechanism should be used (ie, an OSGiLogger which is updated with the current service reference whenever it changes, and can handle having a null service reference. Alternatively some form of a proxy object could be returned and the object that proxy wraps could be updated as needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.