@Test public void shouldWriteRawStrings() { Logging logging = initLogging(ApocConfig.LoggingType.raw, 10000, 10); String stringWithWhitespaces = logging.format("Test %s ", asList(1)); String stringWithWhitespacesAndTabs = logging.format("Test %s \t", asList(1)); String stringWithWhitespacesAndTabsAndNewLine = logging.format("Test %s \t\nNewLine", asList(1)); Assert.assertEquals("Test 1 ", stringWithWhitespaces); Assert.assertEquals("Test 1 \t", stringWithWhitespacesAndTabs); Assert.assertEquals("Test 1 \t\nNewLine", stringWithWhitespacesAndTabsAndNewLine); }
public String format(String message, List<Object> params) { if (canLog()) { String formattedMessage = String.format(message, params.isEmpty() ? new Object[0] : params.toArray(new Object[params.size()])); if (ApocConfig.LoggingType.safe == apocConfig.getLoggingType()) { return formattedMessage.replaceAll("\\.| |\\t", "_").toLowerCase(); } return formattedMessage; } return null; }
Logging { public String format(String message, List<Object> params) { if (canLog()) { String formattedMessage = String.format(message, params.isEmpty() ? new Object[0] : params.toArray(new Object[params.size()])); if (ApocConfig.LoggingType.safe == apocConfig.getLoggingType()) { return formattedMessage.replaceAll("\\.| |\\t", "_").toLowerCase(); } return formattedMessage; } return null; } }
Logging { public String format(String message, List<Object> params) { if (canLog()) { String formattedMessage = String.format(message, params.isEmpty() ? new Object[0] : params.toArray(new Object[params.size()])); if (ApocConfig.LoggingType.safe == apocConfig.getLoggingType()) { return formattedMessage.replaceAll("\\.| |\\t", "_").toLowerCase(); } return formattedMessage; } return null; }  }
Logging { public String format(String message, List<Object> params) { if (canLog()) { String formattedMessage = String.format(message, params.isEmpty() ? new Object[0] : params.toArray(new Object[params.size()])); if (ApocConfig.LoggingType.safe == apocConfig.getLoggingType()) { return formattedMessage.replaceAll("\\.| |\\t", "_").toLowerCase(); } return formattedMessage; } return null; }  @Procedure @Description("apoc.log.error(message, params) - logs error message") void error(@Name("message") String message,
                      @Name(value = "params", defaultValue = "[]") List<Object> params); @Procedure @Description("apoc.log.warn(message, params) - logs warn message") void warn(@Name("message") String message,
                     @Name(value = "params", defaultValue = "[]") List<Object> params); @Procedure @Description("apoc.log.info(message, params) - logs info message") void info(@Name("message") String message,
                     @Name(value = "params", defaultValue = "[]") List<Object> params); @Procedure @Description("apoc.log.debug(message, params) - logs debug message") void debug(@Name("message") String message,
                      @Name(value = "params", defaultValue = "[]") List<Object> params); String format(String message, List<Object> params); }
Logging { public String format(String message, List<Object> params) { if (canLog()) { String formattedMessage = String.format(message, params.isEmpty() ? new Object[0] : params.toArray(new Object[params.size()])); if (ApocConfig.LoggingType.safe == apocConfig.getLoggingType()) { return formattedMessage.replaceAll("\\.| |\\t", "_").toLowerCase(); } return formattedMessage; } return null; }  @Procedure @Description("apoc.log.error(message, params) - logs error message") void error(@Name("message") String message,
                      @Name(value = "params", defaultValue = "[]") List<Object> params); @Procedure @Description("apoc.log.warn(message, params) - logs warn message") void warn(@Name("message") String message,
                     @Name(value = "params", defaultValue = "[]") List<Object> params); @Procedure @Description("apoc.log.info(message, params) - logs info message") void info(@Name("message") String message,
                     @Name(value = "params", defaultValue = "[]") List<Object> params); @Procedure @Description("apoc.log.debug(message, params) - logs debug message") void debug(@Name("message") String message,
                      @Name(value = "params", defaultValue = "[]") List<Object> params); String format(String message, List<Object> params); @Context
    public Log log; @Context
    public ApocConfig apocConfig; }