library/src/main/java/com/kdgregory/aws/utils/cloudwatch/MetricReporter.java
/**
     *  Constructs a logging message that depends on log level.
     */
Constructs a logging message that depends on log level.
Constructs a logging message that depends on log level .
private String constructLogMessage(List<MetricDatum> batch)
    {
        StringBuilder sb = new StringBuilder(512);
        sb.append("flush sending ").append(batch.size()).append(" metric");
        if (batch.size() > 1)
            sb.append("s");
        if (batchLoggingLevel == LoggingLevel.NAMES)
        {
            sb.append(": ");
            for (MetricDatum datum : batch)
                sb.append(datum.getMetricName()).append(", ");
            sb.delete(sb.length() - 2, sb.length());
        }
        if (batchLoggingLevel == LoggingLevel.DETAILED)
        {
            sb.append(":");
            for (MetricDatum datum : batch)
            {
                sb.append("\n    ")
                  .append(datum.getMetricName()).append(": ")
                  .append(datum.getValue()).append(" ")
                  .append(datum.getUnit()).append(" @ ")
                  .append(datum.getStorageResolution());
            }
        }
        return sb.toString();
    }
private String constructLogMessage ( List < MetricDatum > batch ) { StringBuilder sb = new StringBuilder ( 512 ) ; sb . append ( "flush sending " ) . append ( batch . size ( ) ) . append ( " metric" ) ; if ( batch . size ( ) > 1 ) sb . append ( "s" ) ; if ( batchLoggingLevel == LoggingLevel . NAMES ) { sb . append ( ": " ) ; for ( MetricDatum datum : batch ) sb . append ( datum . getMetricName ( ) ) . append ( ", " ) ; sb . delete ( sb . length ( ) - 2 , sb . length ( ) ) ; } if ( batchLoggingLevel == LoggingLevel . DETAILED ) { sb . append ( ":" ) ; for ( MetricDatum datum : batch ) { sb . append ( "\n    " ) . append ( datum . getMetricName ( ) ) . append ( ": " ) . append ( datum . getValue ( ) ) . append ( " " ) . append ( datum . getUnit ( ) ) . append ( " @ " ) . append ( datum . getStorageResolution ( ) ) ; } } return sb . toString ( ) ; }
Constructs a logging message that depends on log level.
Constructs a logging message that depends on log level .