Hello,
> - javalog: wants some GLOBAL_LOGGER_NAME, which
> I can't find anywhere. So someone with more Java
> background wants to have a look?
GLOBAL_LOGGER_NAME is Java 6. In Java 5,
there is java.util.logging.Logger/global which is deprecated
in Java 6.
diff --git a/src/clojure/contrib/javalog.clj b/src/clojure/contrib/
javalog.clj
index be66249..29f2afc 100644
--- a/src/clojure/contrib/javalog.clj
+++ b/src/clojure/contrib/javalog.clj
@@ -29,9 +29,11 @@
:doc "The current java.util.logging.Logger. By default, the
global logger, modified by 'with-logger'."}
*logger*
- (. Logger
- (getLogger
- (. Logger GLOBAL_LOGGER_NAME))))
+ (try
+ (Logger/getLogger
+ (.getStaticField clojure.lang.Reflector Logger
"GLOBAL_LOGGER_NAME"))
+ (catch IllegalArgumentException illarg
+ Logger/global)))
Reflector seems to be needed because NoSuchFieldException is thrown at
compile time if written
as (Logger/getLogger Logger/GLOBAL_LOGGER_NAME).
I don't have a contributors agreement although I intend to sign it; in
any case this is a trivial patch,
I am sure anybody who needs it can come up with their own version ;-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---