public static FilteredLogger getFilteredLogger(final String className) { return new FilteredLogger(className); }
public void clearAccessorCache() throws GadgetException { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "clearAccessorCache"); } try { this.cache.clearAccessors(); } catch (final OAuth2CacheException e) { if (isLogging) { BasicOAuth2Store.LOG.log("Error clearing OAuth2 Accessor cache", e); } throw new GadgetException(Code.OAUTH_STORAGE_ERROR, "Error clearing OAuth2Accessor cache", e); } if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "clearAccessorCache"); } }
private static String filteredParam(final Object param) { final String paramString; if (param != null) { paramString = FilteredLogger.filterSecrets(param.toString()); } else { paramString = ""; } return paramString; }
public static boolean runImport(final OAuth2Persister source, final OAuth2Persister target, final boolean clean) { if (BasicOAuth2Store.LOG.isLoggable()) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "runImport", new Object[] { source, target, clean }); } // No import for default persistence return false; }
@Inject public GadgetOAuth2TokenStore(final OAuth2Store store, final GadgetSpecFactory specFactory) { this.store = store; this.specFactory = specFactory; if (GadgetOAuth2TokenStore.LOG.isLoggable()) { GadgetOAuth2TokenStore.LOG.log("this.store = {0}", this.store); GadgetOAuth2TokenStore.LOG.log("this.specFactory = {0}", this.specFactory); } }
public void log(final Level logLevel, final String msg, final Object param) { this.logger.log(logLevel, FilteredLogger.filterSecrets(msg), FilteredLogger.filteredParam(param)); }
public void storeOAuth2Accessor(final OAuth2Accessor accessor) { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "storeOAuth2Accessor", accessor); } this.cache.storeOAuth2Accessor(accessor); if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "storeOAuth2Accessor"); } }
@Test public void testLog_6() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final Level logLevel = Level.FINE; final String msg = ""; final Object[] params = new Object[] {}; fixture.log(logLevel, msg, params); } }
@Test public void testIsLoggable_1() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final boolean result = fixture.isLoggable(); Assert.assertEquals(false, result); }
@Test public void testEntering_3() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; final Object[] params = new Object[] {}; fixture.entering(sourceClass, sourceMethod, params); }
log = FilteredLogger.getFilteredLogger("org.apache.shindig.gadgets.oauth2.OAuth2Error"); final ResourceBundle resourceBundle = log.getResourceBundle(); if (resourceBundle != null) { final String bundleHeader = resourceBundle.getString("message_header"); if (log.isLoggable()) { log.log("error loading OAuth2Error messages", e);
@Test public void testExiting_1() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; fixture.exiting(sourceClass, sourceMethod); }
@Test public void testGetResourceBundle_1() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final ResourceBundle result = fixture.getResourceBundle(); Assert.assertNotNull(result); }
@Test public void testFilteredLogger_1() throws Exception { final String className = ""; final FilteredLogger result = new FilteredLogger(className); Assert.assertNotNull(result); Assert.assertEquals(false, result.isLoggable()); }
public void log(final Level logLevel, final String msg, final Object[] params) { this.logger.log(logLevel, FilteredLogger.filterSecrets(msg), FilteredLogger.filteredParams(params)); }
public void log(final String msg, final Object[] params) { this.log(FilteredLogger.DEFAULT_LOG_LEVEL, msg, params); }
public boolean isLoggable() { return this.isLoggable(FilteredLogger.DEFAULT_LOG_LEVEL); }
private static String[] filteredParams(final Object[] params) { final String[] paramStrings; if (params != null) { paramStrings = new String[params.length]; int i = 0; for (final Object param : params) { if (param != null) { paramStrings[i] = FilteredLogger.filteredParam(param.toString()); } else { paramStrings[i] = ""; } i++; } } else { paramStrings = new String[] {}; } return paramStrings; }
public OAuth2Accessor getOAuth2Accessor(final OAuth2CallbackState state) { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "getOAuth2Accessor", state); } final OAuth2Accessor ret = this.cache.getOAuth2Accessor(state); if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "getOAuth2Accessor", ret); } return ret; }
@Test public void testLog_3() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String msg = ""; final Object[] params = new Object[] {}; fixture.log(msg, params); }