UtilityPack.Logger
1.0.2.1
See the version list below for details.
dotnet add package UtilityPack.Logger --version 1.0.2.1
NuGet\Install-Package UtilityPack.Logger -Version 1.0.2.1
<PackageReference Include="UtilityPack.Logger" Version="1.0.2.1" />
paket add UtilityPack.Logger --version 1.0.2.1
#r "nuget: UtilityPack.Logger, 1.0.2.1"
// Install UtilityPack.Logger as a Cake Addin #addin nuget:?package=UtilityPack.Logger&version=1.0.2.1 // Install UtilityPack.Logger as a Cake Tool #tool nuget:?package=UtilityPack.Logger&version=1.0.2.1
Logger
Logger mette a disposizione una singola classe statica, con al suo interno diversi metodi a loro volta statici che si occupano di eseguire rapide scritture di file su disco in luoghi predefiniti.
Enumeratori
LogLocation
Definizioni per i luoghi dove impostare la cartella madre per i log.
public enum LogLocation
{
ROOT,
CUSTOM,
EXEPOS,
PROGDATA,
APPDATAROAM,
APPDATALOCA
}
- ROOT = C:\
- CUSTOM = cartella libera
- EXEPOS = stessa cartella in cui si trova l'eseguibile
- PROGDATA = C:\ProgramData\
- APPDATAROAM = ..\AppData\Roaming
- APPDATALOCA = ..\AppData\Local
Proprietà di Logger
IsLogActive : bool
Valore booleano, solo se impostato a 'true' i metodi di Logger salveranno effettivamente i file su disco.
LogDirSub : string
Stringa per definire sottocartelle su cui scrivere i file, la sottocartella è posizionata dentro la cartella principale, definita dal metodo SetLogLocation().
Metodi di Logger
SetLogLocation
Usata per definire il luogo dove è posizionata la cartella madre di logging, richiede un valore dell'enumeratore LogLocation.
Il parametro 'customDir' è necessario unicamente se si sceglie il valore 'LogLocation.CUSTOM'.
SetLogLocation(LogLocation location, string customDir = "")
LogText
Scrive su disco un testo, come argomenti richiede il testo da scrivere e l'eventuale nome aggiuntivo del file.
Formato del file .txt
LogText(string text, string name = "")
LogJson
Scrive su disco un oggetto json, come argomenti richiede un oggetto serializzabile come json e l'eventuale nome aggiuntivo del file.
Formato del file .json
LogJson(object obj, string name = "")
LogJson
Scrive su disco un oggetto json, come argomenti richiede un testo in formato json e l'eventuale nome aggiuntivo del file.
Formato del file .json
LogJson(string text, string name = "")
LogJsonList
Scrive su disco una lista di oggetti json, come argomenti richiede una lista di oggetti serializzabili come json e l'eventuale nome aggiuntivo del file.
Formato del file .json
LogJsonList<T>(List<T> list, string name = "")
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
-
.NETCoreApp 3.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.8 | 462 | 6/30/2022 |
1.1.7 | 419 | 5/31/2022 |
1.1.6 | 419 | 5/16/2022 |
1.1.5 | 418 | 5/16/2022 |
1.1.4 | 428 | 5/16/2022 |
1.1.3 | 426 | 3/29/2022 |
1.1.2 | 441 | 2/17/2022 |
1.1.1 | 434 | 2/17/2022 |
1.1.0 | 440 | 2/4/2022 |
1.0.3 | 436 | 2/4/2022 |
1.0.2.2 | 435 | 2/4/2022 |
1.0.2.1 | 421 | 2/4/2022 |
1.0.2 | 265 | 12/30/2021 |
1.0.1 | 268 | 12/29/2021 |
1.0.0 | 295 | 11/17/2021 |