JT.WriteLog
2.2.0.0
Write-Log is a Powershell logging script.
Write-Log write the log on the console with color and create a 'Log' folder for the log file. The default name of the log is "{Scriptname}_log.txt".
The console color for the log:
ErrorLevel Color
---------- ----------
INFO White
SUCCESS Green
WARNING
Write-Log is a Powershell logging script.
Write-Log write the log on the console with color and create a 'Log' folder for the log file. The default name of the log is "{Scriptname}_log.txt".
The console color for the log:
ErrorLevel Color
---------- ----------
INFO White
SUCCESS Green
WARNING Yellow
ERROR Red
DEBUG DarkYellow
Usage:
Write-Log [-errorLevel] {INFO | SUCCESS | WARNING | ERROR | DEBUG} [[-message] <String>] [[-logRecycling]
{Continue | Daily | Hourly}] [[-logPath] <String>] [-debugMode] [<CommonParameters>]
Installation Options
Owners
Copyright
(c) 2024 Johnny Tse. All rights reserved.
Package Details
Author(s)
- Johnny Tse
Functions
Dependencies
This module has no dependencies.
Release Notes
Version 2.0.0.2: Bug fix: Write-Log created log file using module name when instead of {ScriptName}.
Enhance: It can use $LengthOfFunctionName to adjust the lenght of the 'Function Name' field.
Version 2.0.0.3: Fix: Correct EXAMPLE message.
Version 2.0.0.4: Bug fix: Failure to write file under PowerShell v5.1 or below version.
Version 2.1.0.0: Bug fix: The log file location may be incorrect.
Enhance: Add '<Job>' after the function name field to identify it is call from [Start-Job] / [Start-ThreadJob].
Auto adjust the length of 'Function Name' for write message into log file.
Standardize encoding (to UTF8) between Powershell 5.1 and Powershell Core.
Version 2.2.0.0: Enhance: Improve performance if it did not have write to file or display debug information.
FileList
- JT.WriteLog.nuspec
- JT.WriteLog.psd1
- JT.WriteLog.psm1
Version History
Version | Downloads | Last updated |
---|---|---|
2.2.0.0 (current version) | 11 | 4/16/2025 |
2.1.0.0 | 22 | 3/7/2025 |
2.0.0.4 | 8 | 3/3/2025 |
2.0.0.3 | 17 | 2/26/2025 |
2.0.0.1 | 10 | 1/9/2025 |