haxl-2.1.2.0: A Haskell library for efficient, concurrent, and concise data access.

Safe HaskellSafe
LanguageHaskell2010

Haxl.Core.Flags

Contents

Description

The Flags type and related functions. This module is provided for access to Haxl internals only; most users should import Haxl.Core instead.

Synopsis

Tracing flags

data Flags Source #

Flags that control the operation of the engine.

Constructors

Flags 

Fields

  • trace :: !Int

    Tracing level (0 = quiet, 3 = very verbose).

  • report :: !Int

    Report level: * 0 = quiet * 1 = outgone fetches, for debugging eg: timeouts * 2 = data fetch stats & errors * 3 = (same as 2, this used to enable errors) * 4 = profiling * 5 = log stack traces of dataFetch calls

  • caching :: !Int

    Non-zero if caching is enabled. If caching is disabled, then we still do batching and de-duplication, but do not cache results.

  • recording :: !Int

    Non-zero if recording is enabled. This allows tests to record cache calls for datasources by making uncachedRequest behave like dataFetch

ifTrace :: Monad m => Flags -> Int -> m a -> m () Source #

Runs an action if the tracing level is above the given threshold.

ifReport :: Monad m => Flags -> Int -> m a -> m () Source #

Runs an action if the report level is above the given threshold.

ifProfiling :: Monad m => Flags -> m a -> m () Source #