Skip to content

Logging. Exception not completely inserted in the file. #4

@DHorse2

Description

@DHorse2

The console exceptions handling displays a normal error message:

`=============================================
Error in Script: Mdm_Std_Help.ps1, line 907, column 42
Unable to process document match { insert for file: G:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\XXXXG:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\Mdm_Std_Library
For match: {{File: G:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\XXXXG:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\Mdm_Std_Library}}
Details:
Cannot find path 'G:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\XXXXG:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\Mdm_Std_Library' because it does not exist.
ObjectNotFound: (G:\Script\Powershel…les\Mdm_Std_Library:String) [Get-Content], ItemNotFoundException

Stack trace:
Function_Name Link Calling_Function

Frame[0]: Add-LogError, line 819. Mdm_Std_Etl.ps1:819: Mdm_Std_Etl.ps1 at line 760…
Frame[1]: Add-LogText, line 760. Mdm_Std_Etl.ps1:760: Mdm_Std_Help.ps1 at line 912…
Frame[2]: ConvertFrom-Template, line 912. Mdm_Std_Help.ps1:912: Mdm_Std_Help.ps1 at line 126…
Frame[3]: Export-Mdm_Help, line 126. Mdm_Std_Help.ps1:126: DevEnv_Install_Modules_Win.ps1 at line 336…
Frame[4]: DevEnv_Install_Modules_Win, line 336. DevEnv_Install_Modules_Win.ps1:336: None…

=============================================
`

Immediately followed by output from a called script execution pause function.

It displays similar output:

WARNING: Script Debugger for function: Add-LogError pause for interupt
WARNING: Called by Mdm_Std_Etl.ps1, Line: 768
WARNING: (You can add a breakpoint location here:)
WARNING: Script Debugger in Mdm_Std_Error.ps1, Line: 194
Stack:
Function_Name Link Calling_Function


Frame[0]: Debug-Script, line 218. Mdm_Std_Error.ps1:218: Mdm_Std_Etl.ps1 at line 768
Frame[1]: Add-LogText, line 768. Mdm_Std_Etl.ps1:768: Mdm_Std_Help.ps1 at line 912
Frame[2]: ConvertFrom-Template, line 912. Mdm_Std_Help.ps1:912: Mdm_Std_Help.ps1 at line 126
Frame[3]: Export-Mdm_Help, line 126. Mdm_Std_Help.ps1:126: DevEnv_Install_Modules_Win.ps1 at line 336
Frame[4]: DevEnv_Install_Modules_Win, line 336. DevEnv_Install_Modules_Win.ps1:336: None
WARNING: Pause exection timer for the next 60 seconds.
You can:

  1. Press the debug pause button followed by step out and "Y".
  2. Enter "Y" to just continue.
  3. Let it time out.

=============================================

The log file is incomplete.

sb an easy fix. It only contains Script Debugger text. That's particular bad because the key info is in the main message.
Content:

Script Debugger for function: Add-LogError pause for interupt
Called by Mdm_Std_Etl.ps1, Line: 768
(You can add a breakpoint location here:)
Script Debugger in Mdm_Std_Error.ps1, Line: 194
Stack:
Function_Name Link Calling_Function


Frame[0]: Debug-Script, line 218. Mdm_Std_Error.ps1:218: Mdm_Std_Etl.ps1 at line 768
Frame[1]: Add-LogText, line 768. Mdm_Std_Etl.ps1:768: Mdm_Std_Help.ps1 at line 912
Frame[2]: ConvertFrom-Template, line 912. Mdm_Std_Help.ps1:912: Mdm_Std_Help.ps1 at line 126
Frame[3]: Export-Mdm_Help, line 126. Mdm_Std_Help.ps1:126: DevEnv_Install_Modules_Win.ps1 at line 336
Frame[4]: DevEnv_Install_Modules_Win, line 336. DevEnv_Install_Modules_Win.ps1:336: None
Pause exection timer for the next 60 seconds.
You can:

  1. Press the debug pause button followed by step out and "Y".
  2. Enter "Y" to just continue.
  3. Let it time out.
    Unable to process document match { insert for file: G:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\XXXXG:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\Mdm_Std_Library
    For match: {{File: G:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\XXXXG:\Script\Powershell\Mdm_Powershell_Modules\src\Modules\Mdm_Std_Library}}
    Readme documentation saved to: G:\Script\Powershell\Mdm_Powershell_Modules\readme.md
  •      Location: G:\Script\Powershell\Mdm_Powershell_Modules\readme.md
    

**Note: ** It did have the message seen at the end here but this needs work.

Solution.

  1. The Script Debugger outputs way too much to the log file. It is a UI component that incedentally gets recorded.
  2. Walk through Add-LogText and Add-LogError. The (Powershell Extension) terminal ouput is correct here and they should match.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions