forked from Kros-sk/TeaPie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoggingSettings.cs
More file actions
46 lines (37 loc) · 1.77 KB
/
Copy pathLoggingSettings.cs
File metadata and controls
46 lines (37 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using Microsoft.Extensions.Logging;
using Spectre.Console.Cli;
using System.ComponentModel;
namespace TeaPie.DotnetTool;
internal class LoggingSettings : CommandSettings
{
[CommandOption("--log-file")]
[Description("Path to the file where all logs will be saved.")]
public string? LogFile { get; init; }
[CommandOption("--log-file-log-level")]
[Description("Log level for the log file (if the log file path is specified). " +
"Supported levels: Trace, Debug, Information, Warning, Error, Critical, None.")]
public LogLevel LogFileLogLevel { get; init; } = LogLevel.Information;
[CommandOption("--requests-log-file")]
[Description("Path to the file where structured JSON data about HTTP requests will be saved.")]
public string? RequestsLogFile { get; init; }
[CommandOption("-l|--log-level")]
[Description("Log level for console output. " +
"Supported levels: Trace, Debug, Information, Warning, Error, Critical, None.")]
public LogLevel LogLevel { get; init; } = LogLevel.Information;
[CommandOption("-d|--debug")]
[DefaultValue(false)]
[Description("Displays debug information. Default: false.")]
public bool IsDebug { get; init; }
[CommandOption("-v|--verbose")]
[DefaultValue(false)]
[Description("Displays all available information, including debug details. Default: false.")]
public bool IsVerbose { get; init; }
[CommandOption("-q|--quiet")]
[DefaultValue(false)]
[Description("Runs command silently, without displaying any output. Default: false.")]
public bool IsQuiet { get; init; }
[CommandOption("--tree-logging")]
[DefaultValue(false)]
[Description("Uses tree-structured console output for logs. Default: false.")]
public bool UseTreeLogging { get; init; }
}