Ability to send the custom messages into VS.Output Window -> Buid pane

Issue #28 resolved
Lukasz Stanczyk created an issue

How can one pass output to the build window? I have pre-build event in interpreter mode. That executes

cmd.exe /C @powershell G:\Workbench\Project1\beforeBuild.ps1 -SolutionDir G:\Workbench\project1

when in output window i select category of build - none of messages from the script are shown.

Comments (9)

  1. Denis Kuzmin repo owner

    if you're searching - how to pass output data as result of your external script/utility (from stdout) into the Output window of Visual Studio:

    • Uncheck the 'Hide process' in the Control section, then you can see all result of your external script in the Output window of VS -> see in Solution Build-Events item

    if you're searching - how to pass output build data from Visual Studio into your external script/utility:

    #[OWP out.Warnings.Raw]
    #[OWP out.All]
    

    etc.

    Thanks for using,

  2. Lukasz Stanczyk reporter

    How about the situation where I want to duplicate that output see it all under output->build?

  3. Denis Kuzmin repo owner

    it's possible, but not implemented in current versions - was not necessary for all...

    so, what's the problem you trying solve ?

    I can implement the next variants:

    • Option to forward the all/specific messages to specific item of the Output panel, e.g.: output->build
    • Extend the components of the SBE-Scripts as similar above to forward direct from stdout.

    and others.,

    However, please more details why it's needed ? :) additional plugin for work with output->build ? or not convenient work with our custom item ?

    Please note, you can also use FileComponent for calling external utilities, for example:

    #[File sout("ls", "-la")]
    

    use testing tool for samples and see in code completion for details about arguments (in latest version used Dom for inspecting model, this wiki contains older specification - this should be updated later)

  4. Denis Kuzmin repo owner

    this feature available with c9ec867 and planned to public release with v0.11

    so, how it works, and what available now with c9ec867:

    • Firstly, I added new Event type - 'Logging', this event based on internal logging model. Now we can catch all messages and send to any other place - files, services, logs, output window etc.
    • I added new properties & methods for OWPComponent (SBE-Scripts core)

    for your task, you can use this with easy script, for example:

    #[OWP item("Build").write(false): #[OWP log.Message]]
    

    also you can redirect messages for another panes, for example:

    #[OWP item("My special").write(true): #[OWP log.Message]]
    

    also, you can get current level of messages with:

    #[OWP log.Level]
    

    clear/activate/delete.. all basic operations

    and of course with SBE-Scripts and MSBuild core you can use this as you want:

    #[( #[OWP log.Level] == INFO ) {
        #[(#[OWP log.Message] ~= Result of command:) {
            #[File write("spec.log"): #[OWP log.Message]]
        }]
    }]
    

    etc.

    Please note:

    • for v0.11 this syntax may be changed... please use wiki/Dom after release
    • you can try this feature with c9ec867 or if needed i can release debug version for test:

    any questions ?

  5. Log in to comment