FileLogger.this

A constructor for the FileLogger Logger that takes a reference to a File.

The File passed must be open for all the log call to the FileLogger. If the File gets closed, using the FileLogger for logging will result in undefined behaviour.

  1. this(string fn, LogLevel lv)
  2. this(string fn, LogLevel lv, CreateFolder createFileNameFolder)
    class FileLogger
    @safe
    this
  3. this(File file, LogLevel lv)

Parameters

fn string

The file used for logging.

lv LogLevel

The LogLevel for the FileLogger. By default the LogLevel for FileLogger is LogLevel.all.

createFileNameFolder CreateFolder

if yes and fn contains a folder name, this folder will be created.

Examples

auto file = File("logFile.log", "w");
auto l1 = new FileLogger(file);
auto l2 = new FileLogger(file, LogLevel.fatal);

Meta