The Utility Unit


exports:  class UtilityUnit

class UtilityUnit

extends:  libflitter/Unit

The UtilityUnit is to add various useful functions to Flitter. It includes logging functions.

go(express app, function next)

overrides:  super.go()         returns:  undefined

Initializes the unit. It creates a logging function that changes whether or not a message prints to console based on the logging level and makes it globally available. It provides the Utility context and calls the next function in the stack under that context.

Utility Context

This context provides access to the various utility functions. At the moment, this is basically just the logging function.

global.log(mixed message, Number level = 1, Boolean strict = false)

returns:  undefined

Passes a message to console.log based on the specified logging level. As long as not strict, if the logging level specified in the config value server.logging.level is greater than the specified level, the message will be passed. If strict, the message will be passed to console.log if and only if the server.logging.level config value is exactly equal to the level.

No Comments
Back to top