Function design_pattern_examples_rust::bridge::bridge_logger::create_logger
source · pub fn create_logger(logger_type: LoggerType, filename: &str) -> Box<dyn ILogger>
Expand description
Factor function that takes a LoggerTypes value to create a new Logger instance.
Parameters
-
logger_type
A value from the LoggerTypes enumeration specifying the type of logger object to create.
-
filename
If creating a LoggerType::ToFile, then
filename
specifies the path and name of the file to write to. Otherwise, this parameter is ignored (just pass an empty string).
Returns
Returns an object represented by the ILogger trait.