Method GetLogger
- Namespace
- WhalesSecret.TradeScriptLib.API
- Assembly
- WhalesSecret.TradeScriptLib.dll
GetLogger(LogLevel, string?, string?)
Creates a new logger with an optional identifier.
ILogger GetLogger(LogLevel logLevel, string? id = null, string? layout = null)
Parameters
logLevel
LogLevelDefault logging level for the newly created logger.
id
stringOptionally, identifier of the logger that can be inserted into every logged message via LayoutId placeholder.
layout
stringOptionally, layout format of log lines. If
null
is provided, the default layout will be used.The layout string should not contain
$
characters, they are replaced by single space characters.The layout may contain any of the following placeholders:
- LayoutTime,
- LayoutThreadId,
- LayoutMdlc,
- LayoutInstanceId,
- LayoutLevel,
- LayoutCallsite,
- LayoutMessage,
- LayoutId.
See DefaultLayout for an example of a layout string.
Returns
- ILogger
Newly created trade script logger.
Exceptions
- InvalidArgumentException
Thrown if
id
orlayout
is too long.