test/test5_disableLog.ps1
#TOFIX: gestion du param�tre source qui ne fonctionne pas en console # faire un param�tre source par d�fault lors de la cr�ation, utilisez dynamicparam pour configurer $source & $path Import-Module ..\uLog.psd1 -Force Remove-Variable -Name uLOG -ErrorAction SilentlyContinue $log = New-uLog $log.AddLogHandler( (New-uLogFile -Source $log.Source -Name local)) $log.AddLogHandler( (New-uLogEventLog -Source $log.Source)) $log.AddLogHandler( (New-uLogFile -Name temp -Path C:\temp\myLog.log)) $log.local.Formatter = [LogFormatter]::FileNoIndent Log-Info -Message 'Hello' Log-Warning -Message 'Attention' -Indent 3 Log-Info -Message 'Hello' $log.local.Enabled = $false Log-Success 'YES !' $log.local.Enabled = $true Log-Error 'Problem' Log-Critical 'Failure' Write-Log -Message 'Youpi' -Level SUCCESS #> 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 } |