org.apache.cassandra.utils

## Class NoSpamLogger

- java.lang.Object
- - org.apache.cassandra.utils.NoSpamLogger

    public class NoSpamLogger
    extends java.lang.Object

Logging that limits each log statement to firing based on time since the statement last fired. Every logger has a unique timer per statement. Minimum time between logging is set for each statement the first time it is used and a subsequent attempt to request that statement with a different minimum time will result in the original time being used. No warning is provided if there is a mismatch. If the statement is cached and used to log directly then only a volatile read will be required in the common case. If the Logger is cached then there is a single concurrent hash map lookup + the volatile read. If neither the logger nor the statement is cached then it is two concurrent hash map lookups + the volatile read.

### Nested Class Summary

Nested Classes
`static class` `NoSpamLogger.Level` Levels for programmatically specifying the severity of a log statement
`class` `NoSpamLogger.NoSpamLogStatement`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `error(long nowNanos, java.lang.String s, java.lang.Object... objects)`
`boolean` `error(java.lang.String s, java.lang.Object... objects)`
`static NoSpamLogger` `getLogger(org.slf4j.Logger logger, long minInterval, java.util.concurrent.TimeUnit unit)`
`static NoSpamLogger.NoSpamLogStatement` `getStatement(org.slf4j.Logger logger, java.lang.String message, long minInterval, java.util.concurrent.TimeUnit unit)`
`NoSpamLogger.NoSpamLogStatement` `getStatement(java.lang.String s)`
`NoSpamLogger.NoSpamLogStatement` `getStatement(java.lang.String s, long minIntervalNanos)`
`NoSpamLogger.NoSpamLogStatement` `getStatement(java.lang.String s, long minInterval, java.util.concurrent.TimeUnit unit)`
`NoSpamLogger.NoSpamLogStatement` `getStatement(java.lang.String key, java.lang.String s)`
`NoSpamLogger.NoSpamLogStatement` `getStatement(java.lang.String key, java.lang.String s, long minIntervalNanos)`
`boolean` `info(long nowNanos, java.lang.String s, java.lang.Object... objects)`
`boolean` `info(java.lang.String s, java.lang.Object... objects)`
`static boolean` `log(org.slf4j.Logger logger, NoSpamLogger.Level level, long minInterval, java.util.concurrent.TimeUnit unit, java.lang.String message, java.lang.Object... objects)`
`static boolean` `log(org.slf4j.Logger logger, NoSpamLogger.Level level, java.lang.String key, long minInterval, java.util.concurrent.TimeUnit unit, long nowNanos, java.lang.String message, java.lang.Object... objects)`
`static boolean` `log(org.slf4j.Logger logger, NoSpamLogger.Level level, java.lang.String key, long minInterval, java.util.concurrent.TimeUnit unit, java.lang.String message, java.lang.Object... objects)`
`boolean` `log(NoSpamLogger.Level l, java.lang.String s, long nowNanos, java.lang.Object... objects)`
`boolean` `warn(long nowNanos, java.lang.String s, java.lang.Object... objects)`
`boolean` `warn(java.lang.String s, java.lang.Object... objects)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getLogger

    public static NoSpamLogger getLogger(org.slf4j.Logger logger,
                                         long minInterval,
                                         java.util.concurrent.TimeUnit unit)

#### log

    public static boolean log(org.slf4j.Logger logger,
                              NoSpamLogger.Level level,
                              long minInterval,
                              java.util.concurrent.TimeUnit unit,
                              java.lang.String message,
                              java.lang.Object... objects)

#### log

    public static boolean log(org.slf4j.Logger logger,
                              NoSpamLogger.Level level,
                              java.lang.String key,
                              long minInterval,
                              java.util.concurrent.TimeUnit unit,
                              java.lang.String message,
                              java.lang.Object... objects)

#### log

    public static boolean log(org.slf4j.Logger logger,
                              NoSpamLogger.Level level,
                              java.lang.String key,
                              long minInterval,
                              java.util.concurrent.TimeUnit unit,
                              long nowNanos,
                              java.lang.String message,
                              java.lang.Object... objects)

#### getStatement

    public static NoSpamLogger.NoSpamLogStatement getStatement(org.slf4j.Logger logger,
                                                               java.lang.String message,
                                                               long minInterval,
                                                               java.util.concurrent.TimeUnit unit)

#### info

    public boolean info(long nowNanos,
                        java.lang.String s,
                        java.lang.Object... objects)

#### info

    public boolean info(java.lang.String s,
                        java.lang.Object... objects)

#### warn

    public boolean warn(long nowNanos,
                        java.lang.String s,
                        java.lang.Object... objects)

#### warn

    public boolean warn(java.lang.String s,
                        java.lang.Object... objects)

#### error

    public boolean error(long nowNanos,
                         java.lang.String s,
                         java.lang.Object... objects)

#### error

    public boolean error(java.lang.String s,
                         java.lang.Object... objects)

#### log

    public boolean log(NoSpamLogger.Level l,
                       java.lang.String s,
                       long nowNanos,
                       java.lang.Object... objects)

#### getStatement

    public NoSpamLogger.NoSpamLogStatement getStatement(java.lang.String s)

#### getStatement

    public NoSpamLogger.NoSpamLogStatement getStatement(java.lang.String key,
                                                        java.lang.String s)

#### getStatement

    public NoSpamLogger.NoSpamLogStatement getStatement(java.lang.String s,
                                                        long minInterval,
                                                        java.util.concurrent.TimeUnit unit)

#### getStatement

    public NoSpamLogger.NoSpamLogStatement getStatement(java.lang.String s,
                                                        long minIntervalNanos)

#### getStatement

    public NoSpamLogger.NoSpamLogStatement getStatement(java.lang.String key,
                                                        java.lang.String s,
                                                        long minIntervalNanos)