Documentation

Hale.FastLogger.System.Log.FastLogger

Log output destination.

Instances For
    @[reducible, inline]

    A log message (just a string for now).

    Equations
    Instances For

      An opaque handle to a running logger set.

      • The mutex-protected buffer.

      • flushAction : Array StringIO Unit

        The flush action (writes buffered content to destination).

      • bufSize : Nat

        Maximum buffer size before auto-flush.

      Instances For

        Flush all buffered messages to the destination. $$\text{flushLogStr} : \text{LoggerSet} \to \text{IO Unit}$$

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def System.Log.FastLogger.newLoggerSet (logType : LogType) (bufSize : Nat := 4096) :

          Create a new LoggerSet for the given destination. $$\text{newLoggerSet} : \text{LogType} \to \text{IO LoggerSet}$$

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Push a log message to the logger. May trigger an auto-flush if the buffer exceeds bufSize. $$\text{pushLogStr} : \text{LoggerSet} \to \text{LogStr} \to \text{IO Unit}$$

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Close the logger: flush remaining messages. $$\text{rmLoggerSet} : \text{LoggerSet} \to \text{IO Unit}$$

              Equations
              Instances For
                def System.Log.FastLogger.withTimedFastLogger {α : Type} (logType : LogType) (action : LoggerSetIO α) :
                IO α

                Convenience: create a timed logger that prepends timestamps. Uses AutoUpdate to cache the current time (updated once per second). $$\text{withTimedFastLogger} : \text{LogType} \to (\text{LoggerSet} \to \text{IO}\ \alpha) \to \text{IO}\ \alpha$$

                Equations
                Instances For