|
| 1 | + |
| 2 | + |
| 3 | +<h1 align='center'>Consolex</h1> |
| 4 | +<p align='center'>Facilitator of reading and writing on the console.</p> |
| 5 | +<p align="center"> |
| 6 | + <a href="https://github.com/wniemiec-io-java/consolex/actions/workflows/windows.yml"><img src="https://github.com/wniemiec-io-java/consolex/actions/workflows/windows.yml/badge.svg" alt=""></a> |
| 7 | + <a href="https://github.com/wniemiec-io-java/consolex/actions/workflows/macos.yml"><img src="https://github.com/wniemiec-io-java/consolex/actions/workflows/macos.yml/badge.svg" alt=""></a> |
| 8 | + <a href="https://github.com/wniemiec-io-java/consolex/actions/workflows/ubuntu.yml"><img src="https://github.com/wniemiec-io-java/consolex/actions/workflows/ubuntu.yml/badge.svg" alt=""></a> |
| 9 | + <a href="https://codecov.io/gh/wniemiec-io-java/consolex"><img src="https://codecov.io/gh/wniemiec-io-java/consolex/branch/master/graph/badge.svg?token=R2SFS4SP86" alt="Coverage status"></a> |
| 10 | + <a href="http://java.oracle.com"><img src="https://img.shields.io/badge/java-11+-D0008F.svg" alt="Java compatibility"></a> |
| 11 | + <a href="https://mvnrepository.com/artifact/io.github.wniemiec-io-java/consolex"><img src="https://img.shields.io/maven-central/v/io.github.wniemiec-io-java/consolex" alt="Maven Central release"></a> |
| 12 | + <a href="https://github.com/wniemiec-io-java/consolex/blob/master/LICENSE"><img src="https://img.shields.io/github/license/wniemiec-io-java/consolex" alt="License"></a> |
| 13 | +</p> |
| 14 | +<hr /> |
| 15 | + |
| 16 | +## ❇ Introduction |
| 17 | +Complete and easy-to-use console, featuring logging, read and write operations on the console, as well as text file display operations. |
| 18 | + |
| 19 | +## ❓ How to use |
| 20 | +1. Add one of the options below to the pom.xml file: |
| 21 | + |
| 22 | +#### Using Maven Central (recomended): |
| 23 | +``` |
| 24 | +<dependency> |
| 25 | + <groupId>io.github.wniemiec-io-java</groupId> |
| 26 | + <artifactId>consolex</artifactId> |
| 27 | + <version>LATEST</version> |
| 28 | +</dependency> |
| 29 | +``` |
| 30 | + |
| 31 | +#### Using GitHub Packages: |
| 32 | +``` |
| 33 | +<dependency> |
| 34 | + <groupId>wniemiec.io.java</groupId> |
| 35 | + <artifactId>consolex</artifactId> |
| 36 | + <version>LATEST</version> |
| 37 | +</dependency> |
| 38 | +``` |
| 39 | + |
| 40 | +2. Run |
| 41 | +``` |
| 42 | +$ mvn install |
| 43 | +``` |
| 44 | + |
| 45 | +3. Use it |
| 46 | +``` |
| 47 | +[...] |
| 48 | +
|
| 49 | +import wniemiec.io.java.Consolex; |
| 50 | +
|
| 51 | +[...] |
| 52 | +
|
| 53 | +String line = "hello world"; |
| 54 | +Consolex.writeHeader(line); |
| 55 | +
|
| 56 | +Consolex.writeLine("Simple console message"); |
| 57 | +
|
| 58 | +Consolex.writeError("Error message"); |
| 59 | +Consolex.writeWarning("Warning message"); |
| 60 | +Consolex.writeInfo("Info message"); |
| 61 | +Consolex.writeDebug("Debug message"); |
| 62 | +
|
| 63 | +System.out.println( Consolex.getHistory() ); |
| 64 | +
|
| 65 | +[...] |
| 66 | +``` |
| 67 | + |
| 68 | +## 📖 Documentation |
| 69 | +| Property |Parameter type|Return type|Description|Default parameter value| |
| 70 | +|----------------|-------------------------------|-----|------------------------|--------| |
| 71 | +|readLine |`void`|`String`|Reads a line from console| - | |
| 72 | +|writeLine |`line: Object`|`void`|Write a line on the console, putting a line break at the end| - | |
| 73 | +|writeLines |`lines: (Object... | List<String>)`|`void`|Write lines on the console, putting a line break at the end of each line| - | |
| 74 | +|write |`content: Object`|`void`|Writes a content on the console without putting a line break at the end of each line| - | |
| 75 | +|writeFileLines | `file: Path`|`void`|Write lines from a text file to the console| - | |
| 76 | +|writeFileLinesWithEnumeration | `file: Path`|`void`|Write lines from a text file to the console. Besides, it shows the line number of each line on the left| - | |
| 77 | +|writeDiv | `symbol: String`|`void`|Writes a division line| `"-"` | |
| 78 | +|writeHeader | `title: Object, symbol: String`|`void`|Writes a title between two dividers| - , `"-"`| |
| 79 | +|writeError | `message: Object`|`void`|Displays an error message.| - | |
| 80 | +|writeWarning | `message: Object`|`void`|Displays a warning message.| - | |
| 81 | +|writeInfo | `message: Object`|`void`|Displays an info message. - | |
| 82 | +|writeDebug | `message: Object`|`void`|Displays a debug message.| - | |
| 83 | +|clearHistory | `void`|`void`|Clears the history of messages sent to the console| - | |
| 84 | +|dumpTo | `file: Path`|`void`|Exports the history of messages sent to the console to a file| - | |
| 85 | +|getHistory | `void`|`List<String>`|Gets messages sent to the console| - | |
| 86 | +|setMarginLeft | `margin: int`|`void`|Defines the distance between messages and the log level tag| - | |
| 87 | +|setLoggerLevel | `level: LogLevel`|`void`|Sets log level. The level defines what type of message will be displayed| - | |
| 88 | +|getLoggerLevel | `void`|`LogLevel`|Gets current log level. The level defines what type of message will be displayed| - | |
| 89 | + |
| 90 | + |
| 91 | +## 🚩 Changelog |
| 92 | +Details about each version are documented in the [releases section](https://github.com/williamniemiec/wniemiec-io-java/consolex/releases). |
| 93 | + |
| 94 | +## 🤝 Contribute! |
| 95 | +See the documentation on how you can contribute to the project [here](https://github.com/wniemiec-io-java/consolex/blob/master/CONTRIBUTING.md). |
| 96 | + |
| 97 | +## 📁 Files |
| 98 | + |
| 99 | +### / |
| 100 | +| Name |Type|Description| |
| 101 | +|----------------|-------------------------------|-----------------------------| |
| 102 | +|dist |`Directory`|Released versions| |
| 103 | +|docs |`Directory`|Documentation files| |
| 104 | +|src |`Directory`| Source files| |
0 commit comments