View source code
Display the source code in std/experimental/logger/filelogger.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
std.experimental.logger.filelogger.FileLogger.this
- multiple declarations
Function FileLogger.this
A constructor for the FileLogger
Logger.
Parameters
Name | Description |
---|---|
fn | The filename of the output file of the FileLogger . If that
file can not be opened for writting an exception will be thrown. |
lv | The LogLevel for the FileLogger . By default the |
Example
auto l1 = new FileLogger("logFile");
auto l2 = new FileLogger("logFile", LogLevel .fatal);
auto l3 = new FileLogger("logFile", LogLevel .fatal, CreateFolder .yes);
Function 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.
Parameters
Name | Description |
---|---|
fn | The file used for logging. |
lv | The LogLevel for the FileLogger . By default the
LogLevel for FileLogger is LogLevel . |
createFileNameFolder | if yes and fn contains a folder name, this folder will be created. |
Example
auto file = File("logFile.log", "w");
auto l1 = new FileLogger(file);
auto l2 = new FileLogger(file, LogLevel .fatal);
Function 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.
Parameters
Name | Description |
---|---|
file | The file used for logging. |
lv | The LogLevel for the FileLogger . By default the
LogLevel for FileLogger is LogLevel . |
Example
auto file = File("logFile.log", "w");
auto l1 = new FileLogger(file);
auto l2 = new FileLogger(file, LogLevel .fatal);
Authors
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.