-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from nextflow-io/feat/summary-text
`beforeText` and `afterText` for summary logs + color filter
- Loading branch information
Showing
8 changed files
with
150 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
plugins/nf-schema/src/main/nextflow/validation/config/SummaryConfig.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package nextflow.validation | ||
|
||
import groovy.util.logging.Slf4j | ||
import groovy.transform.PackageScope | ||
|
||
|
||
/** | ||
* This class allows to model a specific configuration, extracting values from a map and converting | ||
* | ||
* We anotate this class as @PackageScope to restrict the access of their methods only to class in the | ||
* same package | ||
* | ||
* @author : nvnieuwk <[email protected]> | ||
* | ||
*/ | ||
|
||
@Slf4j | ||
@PackageScope | ||
class SummaryConfig { | ||
final public String beforeText | ||
final public String afterText | ||
|
||
SummaryConfig(Map map, Boolean monochromeLogs) { | ||
def config = map ?: Collections.emptyMap() | ||
if (monochromeLogs) { | ||
beforeText = config.beforeText ? Utils.removeColors(config.beforeText): "" | ||
afterText = config.afterText ? Utils.removeColors(config.afterText) : "" | ||
} else { | ||
beforeText = config.beforeText ?: "" | ||
afterText = config.afterText ?: "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters