test/test7_with_Levels.ps1
Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue Remove-Variable -Name Log -ErrorAction SilentlyContinue $log = New-uLog $local = New-uLogFile -Name local $log.AddLogHandler($local) $temp = New-uLogFile -Name temp -Path c:\temp\test7_with_Levels.ps1.log $log.AddLogHandler($temp) $evt = New-uLogEventLog $log.AddLogHandler($evt) #$log.local.Formatter = Format-FileNoIndent Log-Info -Message 'Hello' -Exclude $evt, $temp, ($log.Handlers | ? Name -EQ Console) Log-Warning -Message 'Attention' -Indent 3 -NoDisplayOnTerminal Log-Info -Message 'Hello' Log-Success 'YES !' Log-Error 'Problem' Log-Critical 'Failure' Write-Log -Message 'Youpi' -Level SUCCESS #> $log.Handlers Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog function test-log1 { Log-Info -Message 'Hello' Log-Warning -Message 'Attention' -Indent 3 Log-Info -Message 'Hello' Write-Log -Message 'Youpi' -Level SUCCESS } |