scriptcsnightly - ScriptCs.Logger.ScriptPack 0.1.0

This script pack allows a log level to be set at the script level and provides the following methods to write out messages at the appropriate log level : Error, Warn, Info and Debug.

PM> Install-Package ScriptCs.Logger.ScriptPack -Version 0.1.0 -Source https://www.myget.org/F/scriptcsnightly/api/v3/index.json

Copy to clipboard

> nuget.exe install ScriptCs.Logger.ScriptPack -Version 0.1.0 -Source https://www.myget.org/F/scriptcsnightly/api/v3/index.json

Copy to clipboard

> dotnet add package ScriptCs.Logger.ScriptPack --version 0.1.0 --source https://www.myget.org/F/scriptcsnightly/api/v3/index.json

Copy to clipboard
<PackageReference Include="ScriptCs.Logger.ScriptPack" Version="0.1.0" />
Copy to clipboard
source https://www.myget.org/F/scriptcsnightly/api/v3/index.json

nuget ScriptCs.Logger.ScriptPack  ~> 0.1.0
Copy to clipboard

> choco install ScriptCs.Logger.ScriptPack --version 0.1.0 --source https://www.myget.org/F/scriptcsnightly/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "scriptcsnightly" -SourceLocation "https://www.myget.org/F/scriptcsnightly/api/v2"
Install-Module -Name "ScriptCs.Logger.ScriptPack" -RequiredVersion "0.1.0" -Repository "scriptcsnightly" 
Copy to clipboard

scriptcs-logger

About

This Script Pack for scriptcs provides a simple logger.

This script pack allows a log level to be set at the script level and provides the following methods to write out messages at the appropriate log level :

  • Error
  • Warn
  • Info
  • Debug

Installation

Install the nuget package by running

scriptcs -install ScriptCs.Logger.ScriptPack

Usage

Obtain a reference to the Script Pack.

var logger = Require<Logger>();

You can then log messages at different log levels as follows:

logger.Error("Error message.");
logger.Warn("Warning message.");
logger.Debug("Debug message.");
logger.Info("Info message.");

Configuration

The log level for your script can be configured via script arguments as follows:

> scriptcs logger.csx -- -loglevel warn

This will only log the messages for warnings and below. The log levels are ordered as follows:

Error 	= 1,
Warn 	= 2,
Info 	= 3,
Debug 	= 4 

Sample

A example of how to use the Script Pack is available in the sample folder.

  • Any 0.0
    • ScriptCs.Contracts (>= 0.9.0)
  • .NETFramework 4.5: 4.5.0.0

Owners

scriptcs

Authors

Paul Bouwer

Project URL

https://github.com/paulbouwer/scriptcs-logger

License

MIT

Tags

logging csx scriptcs

Info

0 total downloads
0 downloads for version 0.1.0
Download (5.77 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
0.1.0 5.77 KB Wed, 22 Feb 2017 02:13:48 GMT 0