1 package org.apache.maven.shared.utils.logging; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 /** 23 * Message builder that supports configurable styling. 24 * @see MessageUtils 25 */ 26 public interface MessageBuilder 27 { 28 /** 29 * Append message content for DEBUG level. 30 * By default, bold cyan 31 */ 32 MessageBuilder debug( Object message ); 33 34 /** 35 * Append message content for INFO level. 36 * By default, bold blue 37 */ 38 MessageBuilder info( Object message ); 39 40 /** 41 * Append message content in warning style or WARNING level. 42 * By default, bold yellow 43 */ 44 MessageBuilder warning( Object message ); 45 46 /** 47 * Append message content for ERROR level. 48 * By default, bold red 49 */ 50 MessageBuilder error( Object message ); 51 52 /** 53 * Append message content in success style. 54 * By default, bold green 55 */ 56 MessageBuilder success( Object message ); 57 58 /** 59 * Append message content in failure style. 60 * By default, bold red 61 */ 62 MessageBuilder failure( Object message ); 63 64 /** 65 * Append message content in strong style. 66 * By default, bold 67 */ 68 MessageBuilder strong( Object message ); 69 70 /** 71 * Append message content in mojo style. 72 * By default, green 73 */ 74 MessageBuilder mojo( Object message ); 75 76 /** 77 * Append message content in project style. 78 * By default, cyan 79 */ 80 MessageBuilder project( Object message ); 81 82 // 83 // message building methods modelled after Ansi methods 84 // 85 /** 86 * Append content to the message buffer. 87 */ 88 MessageBuilder a( char[] value, int offset, int len ); 89 90 /** 91 * Append content to the message buffer. 92 */ 93 MessageBuilder a( char[] value ); 94 95 /** 96 * Append content to the message buffer. 97 */ 98 MessageBuilder a( CharSequence value, int start, int end ); 99 100 /** 101 * Append content to the message buffer. 102 */ 103 MessageBuilder a( CharSequence value ); 104 105 /** 106 * Append content to the message buffer. 107 */ 108 MessageBuilder a( Object value ); 109 110 /** 111 * Append newline to the message buffer. 112 */ 113 MessageBuilder newline(); 114 115 /** 116 * Append formatted content to the buffer. 117 * @see String#format(String, Object...) 118 */ 119 MessageBuilder format( String pattern, Object... args ); 120 }