Skip to content

Commit

Permalink
Merge pull request #4 from sikorka/github-workflow
Browse files Browse the repository at this point in the history
GitHub workflow
  • Loading branch information
sikorka authored Nov 13, 2023
2 parents 879dc2b + a926905 commit 7a326a7
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 64 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Test with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn -B clean test --file pom.xml
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

78 changes: 49 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
[![Build Status](https://travis-ci.org/sikorka/tiny-log.svg?branch=master)](https://travis-ci.org/sikorka/tiny-log)
[![Build Status](https://github.com/sikorka/tiny-log/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/sikorka/tiny-log/actions/workflows/maven.yml)
[![Coverage Status](https://coveralls.io/repos/github/sikorka/tiny-log/badge.svg)](https://coveralls.io/github/sikorka/tiny-log)

Never miss a log message.

|_ . _ | _ _
|_ | | ) \/ | (_) (_)
/ _/
____ _ _
| _ \ (_) __| | _ _ ___ _ _
| | | | | | / _` | | | | | / _ \ | | | |
| |_| | | | | (_| | | |_| | | (_) | | |_| |
|____/ |_| \__,_| \__, | \___/ \__,_|
|___/
_ _
___ | |_ __ _ _ __ | |_
/ __| | __| / _` | | '__| | __|
\__ \ | |_ | (_| | | | | |_
|___/ \__| \__,_| |_| \__|
_ _ ___
/ \ _ __ _ __ (_) _ _ _ __ ___ |__ \
/ _ \ | '_ \ | '_ \ | | | | | | | '_ ` _ \ / /
/ ___ \ | |_) | | |_) | | | | |_| | | | | | | | |_|
/_/ \_\ | .__/ | .__/ |_| \__,_| |_| |_| |_| (_)
|_| |_|


Tiny Log solves the problem of unnoticed and unreadable messages in command line window: it highlights
messages using <font color="red">colors</font>, **styles**, SIZES, *ASCII art fonts* and added space
Expand All @@ -30,21 +46,19 @@ Add a dependency into your `pom.xml`:
<dependency>
<groupId>com.github.sikorka</groupId>
<artifactId>tiny-log</artifactId>
<version>2.1</version>
<version>2.2</version>
</dependency>

In the class that's about to log msgs add on top (import statically):

import static com.github.sikorka.TinyLog.*;

You can now add in your class:

String something = "Hello there!";

say(something);
sayLoud(something);
highlight(something);
shout(something);
say("Hello!");
sayLoud("Loud hello!");
highlight("Highlighted hello.");
shout("Shouting!");

To add several lines in between log msgs use:

Expand Down Expand Up @@ -121,24 +135,22 @@ How it works

2. By using ASCII art for highlighting VERY IMPORTANT messages, like so:

____ _ _
| _ \ (_) __| | _ _ ___ _ _
| | | | | | / _` | | | | | / _ \ | | | |
| |_| | | | | (_| | | |_| | | (_) | | |_| |
|____/ |_| \__,_| \__, | \___/ \__,_|
|___/
_ _
___ | |_ __ _ _ __ | |_
/ __| | __| / _` | | '__| | __|
\__ \ | |_ | (_| | | | | |_
|___/ \__| \__,_| |_| \__|
_ _ ___
/ \ _ __ _ __ (_) _ _ _ __ ___ |__ \
/ _ \ | '_ \ | '_ \ | | | | | | | '_ ` _ \ / /
/ ___ \ | |_) | | |_) | | | | |_| | | | | | | | |_|
/_/ \_\ | .__/ | .__/ |_| \__,_| |_| |_| |_| (_)
|_| |_|
```
_____ _ _ _ _
/ ____| | | (_) | | | |
| (___ ___ _ __ __ __ ___ _ __ | | _ | | __ ___ | | _ _
\___ \ / _ \ | '__| \ \ / / / _ \ | '__| | | | | | |/ / / _ \ | | | | | |
____) | | __/ | | \ V / | __/ | | | | | | | < | __/ | | | |_| |
|_____/ \___| |_| \_/ \___| |_| |_| |_| |_|\_\ \___| |_| \__, |
__/ |
|___/
_ _ _ _
| | | | | | | |
___ __ __ ___ _ __ | | ___ __ _ __| | ___ __| | | |
/ _ \ \ \ / / / _ \ | '__| | | / _ \ / _` | / _` | / _ \ / _` | | |
| (_) | \ V / | __/ | | | | | (_) | | (_| | | (_| | | __/ | (_| | |_|
\___/ \_/ \___| |_| |_| \___/ \__,_| \__,_| \___| \__,_| (_)
```


TODO
Expand All @@ -150,3 +162,11 @@ TODO
- add javadoc for basic usage
- create predefined, lazy outfits
- perhaps rename to color-log (?)


With love,
```
|_ . _ | _ _
|_ | | ) \/ | (_) (_)
/ _/
```
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.sikorka</groupId>
<artifactId>tiny-log</artifactId>
<version>2.1</version>
<version>2.2</version>

<name>Tiny Log</name>
<description>Makes command line messages pop.</description>
Expand Down Expand Up @@ -92,7 +92,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<version>2.22.2</version>
<configuration>
<includes>
<include>**/*Test.class</include>
Expand All @@ -104,10 +104,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.11.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/github/sikorka/Outfit.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* Dresses up {@link TinyLog} in pretty colors / sizes and fonts.
*/
public class Outfit {
//TODO add specific texts before msg, like [DEBUG]
//highlight just that text

//TODO create predefined, lazy loggers
//GIRLY - with pink (and blue?) colors
Expand Down Expand Up @@ -232,23 +230,23 @@ public Font getShoutFont() {
}


public static void main(String args[]) {
public static void main(String[] args) {
Outfit b = new Outfit()
.shoutColor(Color.BOLD_PURPLE)
.shoutFont(Font.THIN_STRAIGHT)
.shoutCase(Case.UPPER);
dressUp(b);
say("------ colors");
say("say");
shout("shout");
shout("shout!");


Outfit a = new Outfit()
.shoutFont(null)
.highlightFont(null);
dressUp(a);
say("------ fonts");
shout("shout");
shout("shouting");
highlight("highlight");
say("say");
sayLoud("say loud");
Expand All @@ -261,7 +259,7 @@ public static void main(String args[]) {
TinyLog.dressUp(c);
say("------ upper lower case");
say("say");
shout("shout");
shout("shouted");
highlight("highlight");
sayLoud("say loud");
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/github/sikorka/tinylog/Font.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public enum Font {
BIG_BLOCK("block", 10);


final static String URL = "http://www.figlet.org/fonts/";
final static String CLASSPATH = "classpath:/";
final static String EXTENSION = "flf";
static final String URL = "http://www.figlet.org/fonts/";
static final String CLASSPATH = "classpath:/";
static final String EXTENSION = "flf";

/** FLF font file name. */
private final String fontName;
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/github/sikorka/CustomLogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,28 @@ public static void bringBackPreviousOutfit() {
}

@Test
public void sayPlainTest() {
void sayPlainTest() {
writePlain("Writing plain.");
}

@Test
public void sayTest() {
void sayTest() {
say("Just sayin.");
}


@Test
public void sayLoudTest() {
void sayLoudTest() {
sayLoud("Saying loud.");
}

@Test
public void shoutTest() {
void shoutTest() {
shout("Shouting!");
}

@Test
public void highlightTest() {
void highlightTest() {
highlight("Highlighting.");
}

Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/github/sikorka/MyLogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ public static void bringBackPreviousOutfit() {
}

@Test
public void sayTest() {
void sayTest() {
say("Just sayin in non-bold yellow.");
}

@Test
public void sayLoudTest() {
void sayLoudTest() {
sayLoud("Saying loud in uppercase with bold purple.");
}

@Test
public void shoutTest() {
void shoutTest() {
shout("Shouting blue bg with bold bright yellow text.");
}

@Test
public void highlightTest() {
void highlightTest() {
highlight("HIGHLIGHTING in non-bold blue.");
}

Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/github/sikorka/TinyLogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,44 @@
/**
* Checks tiny-log.
*/
public class TinyLogTest extends AbstractTinyLogTest {
class TinyLogTest extends AbstractTinyLogTest {

@Test
public void sayCheck() {
void sayCheck() {
writePlain("In the depth of logs...");
writePlain("And unnoticed messages!");
say("I am saying something.");
writePlain("Did you see me there?");
}

@Test
public void sayLoudCheck() {
void sayLoudCheck() {
sayLoud("I am saying something loud, so you notice me.");
}

@Test
public void shoutCheck() {
void shoutCheck() {
shout("Did you start Appium?");
}

@Test
public void highlightCheck() {
void highlightCheck() {
writePlain("In the depth of logs...");
writePlain("And unnoticed messages!");
highlight("I am highlighting a problem here, so you notice me.");
writePlain("Did you see me?");
}

@Test
public void highlightUppercaseTest() {
void highlightUppercaseTest() {
writePlain("Well, hello...");
writePlain("Let's spell this out loud:");
highlight("I AM HIGHLIGHTING A PROBLEM HERE, SO YOU NOTICE ME.");
writePlain("Could you possibly not see me?");
}

@Test
public void highlightHoustonTest() {
void highlightHoustonTest() {
writePlain("In the depth of logs...");
writePlain("And unnoticed messages!");
highlight("Houston? We've got issues.");
Expand Down

0 comments on commit 7a326a7

Please sign in to comment.