drasil-code-0.1.9.0: A framework for code and document generation for scientific software - Code SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Code.Imperative.Logging

Synopsis

Documentation

maybeLog :: OOProg r => SVariable r -> GenState [MSStatement r] Source #

Generates a statement that logs the given variable's value, if the user chose to turn on logging of variable assignments.

logBody :: OOProg r => Label -> [SVariable r] -> [MSBlock r] -> GenState (MSBody r) Source #

Generates the body of a function with the given name, list of parameters, and blocks to include in the body. If the user chose to turn on logging of function calls, statements that log how the function was called are added to the beginning of the body.

loggedMethod :: OOProg r => FilePath -> Label -> [SVariable r] -> MSBlock r Source #

Generates a block that logs, to the given FilePath, the name of a function, and the names and values of the passed list of variables. Intended to be used as the first block in the function, to log that it was called and what inputs it was called with.

varLogFile :: OOProg r => SVariable r Source #

The variable representing the log file in write mode.