log package:xmonad-contrib

The action to perform when the windows set is changed. This happens whenever focus change, a window is moved, etc. logHook =+ takes an X () and appends it via (>>). For instance:
import XMonad.Hooks.ICCCMFocus
...
logHook =+ takeTopFocus
Note that if your expression is parametrically typed (e.g. of type MonadIO m => m ()), you'll need to explicitly annotate it, like so:
logHook =+ (io $ putStrLn "Hello, world!" :: X ())
A Logger to display the current mode.
Get the classname of the focused window.
Get the classname of the focused window, on the given screen.
Like logClassnamesOnScreen, but directly use the "focused" screen (the one with the currently focused workspace).
Variant of logClassnames, but with support for urgent windows.
Get the classnames of all windows on the visible workspace of the given screen and format them according to the given functions.
Like logClassnamesOnScreen but with support for urgent windows. To be used with XMonad.Hooks.UrgencyHook.
Create a Logger from an arbitrary shell command.
Log the given string, as is.
Get the name of the current workspace.
Get the name of the visible workspace on the given screen.
If the first logger returns Nothing, the default logger is used. For example, to display a quote when no windows are on the screen, you can do:
logDefault logTitle (logConst "Hey, you, you're finally awake.")
Get a count of filtered files in a directory. See maildirUnread and maildirNew source for usage examples.
Get the name of the current layout.
Get the name of the current layout on the given screen.
Create a "spacer" logger, e.g. logSp 3 -- loggerizes ' '. For more complex "spacers", use fixedWidthL with return Nothing.
Get the title (name) of the focused window.
Get the title (name) of the focused window, on the given screen.
Like logTitlesOnScreen, but directly use the "focused" screen (the one with the currently focused workspace).
Variant of logTitles, but with support for urgent windows.
Get the titles of all windows on the visible workspace of the given screen and format them according to the given functions.

Example

myXmobarPP :: X PP
myXmobarPP = pure $ def
{ ppOrder  = [ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused   = wrap "[" "]" . xmobarColor "#ff79c6" "" . shorten 50 . xmobarStrip
formatUnfocused = wrap "(" ")" . xmobarColor "#bd93f9" "" . shorten 30 . xmobarStrip
Like logTitlesOnScreen but with support for urgent windows. To be used with XMonad.Hooks.UrgencyHook.