@ Produces @ Logging public Logger createLogger ( InjectionPoint injectionPoint ) { // the annotation should not be null as it is a qualifier for this producer Logging annotation = injectionPoint . getAnnotated ( ) . getAnnotation ( Logging . class ) ; // get the logger name String name = annotation . name ( ) ; // if the name is empty resolve to the class name // that contains the injection point if ( name == null || name . isEmpty ( ) ) { return this . createClassLogger ( injectionPoint ) ; } // get resolver Resolver resolverAnnotation = annotation . resolver ( ) ; ResolverWrapper wrapper = new ResolverAnnotationWrapper ( resolverAnnotation ) ; PropertyResolver resolver = this . resolverFactory . createPropertyResolver ( wrapper ) ; Map < Object , Object > bootstrapMap = this . resolverFactory . getBootstrapProperties ( wrapper ) ; Map < Object , Object > defaultMap = this . resolverFactory . getDefaultProperties ( wrapper ) ; // resolve name String resolvedName = resolver . resolveProperties ( name , bootstrapMap , defaultMap ) ; // otherwise use the name to create the logger return Logger . getLogger ( resolvedName ) ; }
Creates a Logger with using the class name of the injection point .