Skip to content

Commit

Permalink
fix output according to #1931
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed May 17, 2018
1 parent 2c369e3 commit 364ee36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/Fake.Core.Trace/Trace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ let setBuildNumber number =
let closeAllOpenTags() = Seq.iter (fun (_, tag) -> closeTagUnsafeEx TagStatus.Failed tag) openTags.Value

/// Traces the begin of a target
let traceStartTargetUnsafe name description dependencyString =
let traceStartTargetUnsafe name description (dependencyString:string) =
openTagUnsafe (KnownTags.Target name) description
if not (isNull description) then tracefn " %s" description

/// Traces the begin of a target
[<System.Obsolete("Consider using traceTarget instead and 'use' to properly call traceEndTask in case of exceptions. To remove this warning use 'traceStartTargetUnsafe'.")>]
Expand Down
6 changes: 6 additions & 0 deletions src/app/Fake.Core.Trace/TraceListener.fs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ type ConsoleTraceListener(importantMessagesToStdErr, colorMap, ansiColor) =
write importantMessagesToStdErr color true text
| TraceData.LogMessage(text, newLine) | TraceData.TraceMessage(text, newLine) ->
write false color newLine text
| TraceData.OpenTag(KnownTags.Target _ as tag, description) ->
write false color true (sprintf "Starting %s '%s'" tag.Type tag.Name)
if not (isNull description) then
let msg = TraceData.TraceMessage("", true)
let color2 = colorMap msg
write false color2 true (sprintf " %s" description)

This comment has been minimized.

Copy link
@MangelMaxime

MangelMaxime May 18, 2018

Contributor

Why are we adding a blank space here ?

I think it make the display strange when using multiline description.

Target.Description
    """Setup a local environment for development.

This will start:
    - a local server
    - watch for server file changes and rebuild the server
    - if rebuild is succesful then we restart the server
    - webpack-dev-server for building and watching the client app
    """
Target.create "Watch" (fun _ ->

capture d ecran 2018-05-18 a 14 27 58

This comment has been minimized.

Copy link
@matthid

matthid May 18, 2018

Author Member

Added it only because that was always the behavior. What is the suggestion: To have no space?

This comment has been minimized.

Copy link
@MangelMaxime

MangelMaxime May 18, 2018

Contributor

Yes, my suggestion is to replace:

write false color2 true (sprintf "  %s" description)

by

write false color2 true description

The description is already displayed in green so we know it's a description.

| TraceData.OpenTag (tag, descr) ->
write false color true (sprintf "Starting %s '%s': %s" tag.Type tag.Name descr)
| TraceData.CloseTag (tag, time, status) ->
Expand Down

0 comments on commit 364ee36

Please sign in to comment.