You can see what I have done for an SLF4J binding for the OSGi Log Service 1.4 spec in R7 at https://github.com/osgi/slf4j-osgi. I will note I have not tried it in a while, so it may be in need of some attention.
--

BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
 
 
----- Original message -----
From: "João Assunção via osgi-dev "<osgi-dev@mail.osgi.org>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
Subject: [osgi-dev] How would you implement SLF4J binding ?
Date: Thu, Jul 12, 2018 11:09 AM
 
Hello all,
 
I'm currently trying to implement a facade for a metrics library and one of the objectives is to make its usage agnostic of the runtime environment. At my place, we have some components that are mainly used in the context of an OSGi container but can also be used in plain Java applications. I want to have three implementations of the facade where one makes use of an OSGi service, the other is a plain java library and the third a no-op.  In essence, I want the usage of this facade to be similar to SLF4J. While replicating the mechanism used in SLF4J I remembered someone in this mailing list saying that the way SLF4J binds to the implementations is a hack and not recommended. I agree with the hack part but to me, as a user, it works quite well.
If anyone could suggest better approaches I would be very grateful.
 
PS:
This is what I'm trying to achieve:
 
....
private final Counter aCounter = MetricsFactory.getCounter("aCounter");
...
 
 
Thank you.
 
João Assunção
 
Mobile: +351 916968984
Phone: +351 211933149
 
 
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
 

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to