From 9e730f3a5dfb78f45fe1f7540528d260eb9200db Mon Sep 17 00:00:00 2001 From: Rene Nochebuena Date: Wed, 9 Apr 2025 02:39:25 -0600 Subject: [PATCH] initial commit --- .gitea/workflows/ci-basic.yml | 48 +++++++++++++++++++++++ .gitea/workflows/ci-protected.yml | 48 +++++++++++++++++++++++ .gitea/workflows/ci-tag.yml | 41 ++++++++++++++++++++ .gitignore | 64 +++++++++++++++++++++++++++++++ README.md | 29 +++++++++++++- go.mod | 3 ++ prefixes.go | 50 ++++++++++++++++++++++++ sonar-project.properties | 7 ++++ 8 files changed, 288 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/ci-basic.yml create mode 100644 .gitea/workflows/ci-protected.yml create mode 100644 .gitea/workflows/ci-tag.yml create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 prefixes.go create mode 100644 sonar-project.properties diff --git a/.gitea/workflows/ci-basic.yml b/.gitea/workflows/ci-basic.yml new file mode 100644 index 0000000..3e8fbcf --- /dev/null +++ b/.gitea/workflows/ci-basic.yml @@ -0,0 +1,48 @@ +name: Go CI/CD +run-name: ${{ github.actor }} is running CI/CD basic + +on: + push: + branches-ignore: + - main + - release/** + - develop + pull_request: + branches-ignore: + - main + - release/** + - develop + +jobs: + go-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Download dependencies + shell: bash + run: | + go mod tidy -x + + - name: Run tests + shell: bash + run: | + go test -json > test-report.out + go test -coverprofile=coverage.out + + - name: SonarQube Analysis + uses: SonarSource/sonarqube-scan-action@v5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} + + - name: Build binary + shell: bash + run: | + go build -o ./bin/app main.go \ No newline at end of file diff --git a/.gitea/workflows/ci-protected.yml b/.gitea/workflows/ci-protected.yml new file mode 100644 index 0000000..ddb475b --- /dev/null +++ b/.gitea/workflows/ci-protected.yml @@ -0,0 +1,48 @@ +name: Go CI/CD +run-name: ${{ github.actor }} is running CI/CD protected + +on: + push: + branches: + - main + - release/** + - develop + pull_request: + branches: + - main + - release/** + - develop + +jobs: + go-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Download dependencies + shell: bash + run: | + go mod tidy -x + + - name: Run tests + shell: bash + run: | + go test -json > test-report.out + go test -coverprofile=coverage.out + + - name: SonarQube Analysis + uses: SonarSource/sonarqube-scan-action@v5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} + + - name: Build binary + shell: bash + run: | + go build -o ./bin/app main.go \ No newline at end of file diff --git a/.gitea/workflows/ci-tag.yml b/.gitea/workflows/ci-tag.yml new file mode 100644 index 0000000..6c4ea5f --- /dev/null +++ b/.gitea/workflows/ci-tag.yml @@ -0,0 +1,41 @@ +name: Go CI/CD +run-name: ${{ github.actor }} is running CI/CD Tag + +on: + push: + tags: + - '*' + +jobs: + go-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Download dependencies + shell: bash + run: | + go mod tidy -x + + - name: Run tests + shell: bash + run: | + go test -json > test-report.out + go test -coverprofile=coverage.out + + - name: SonarQube Analysis + uses: SonarSource/sonarqube-scan-action@v5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} + + - name: Build binary + shell: bash + run: | + go build -o ./bin/app main.go \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a820c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +# Binaries for programs and plugins +bin +*.exe +*.dll +*.so +*.dylib +*.test + +# Output of the 'go tool cover' command +*.out +coverage.xml +test-report.xml + +# Directory for Go modules +/vendor/ + +# Go workspace file +go.work +go.work.sum + +# Editor configs +*.swp +*.swo +*.bak +*.tmp +*.log +*.viminfo +*.un~ +Session.vim + +# JetBrains Rider specific +.idea/ +*.iml +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/shelf/ + +# Sublime Text specific +*.sublime-workspace +*.sublime-project + +# VSCode specific +.vscode/ +.vscode/settings.json +.vscode/tasks.json +.vscode/launch.json + +# Emacs specific +*~ +\#*\# +.#* + +# MacOS specific +.DS_Store +.AppleDouble +.LSOverride + +# Node modules (in case of tools/scripts) +node_modules/ + +# Python virtual environments (for dev tools/scripts) +venv/ +*.pyc +__pycache__/ \ No newline at end of file diff --git a/README.md b/README.md index f77d2b0..4d5c3ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ -# stonelog +# 🔥 Stonelog - 10 Billion Times Better Logging! -Stonelog: 10 billion times more epic scientific logging! 🔬💥 Dr.Stone-style quotes, dramatic errors & badass successes. For the glory of the Kingdom of Science! \ No newline at end of file +The most scientifically badass logging library from the Kingdom of Science! + +[![Kingdom of Science Approved](https://img.shields.io/badge/Approved%20By-Kingdom%20of%20Science-blueviolet)]() +[![SO BADASS](https://img.shields.io/badge/Science-SO_BADASS!-blueviolet)]() +[![10 BILLION](https://img.shields.io/badge/10_Billion%25-Scientific-blueviolet)]() + +## 🚀 Why Stonelog? + +- Dr.Stone-themed logging that Senku would approve +- Dramatic error messages worthy of a lab explosion +- Character quotes from your favorite scientists +- 10 billion watts of scientific swagger + +## 💥 Installation + +```bash +go get gitstormr.dev/stone-utils/stonelog@latest +``` + +**Join the Scientific Revolution!** + +> "This isn't just logging - it's 10 billion percent scientific progress!" - Senku Ishigami + +Kingdom of Science Approved + +(Now with 100% more Chrome screaming "SO BADASS!") \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a91786b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module gitstormr.dev/stone-utils/stonelog + +go 1.24 diff --git a/prefixes.go b/prefixes.go new file mode 100644 index 0000000..b81c19c --- /dev/null +++ b/prefixes.go @@ -0,0 +1,50 @@ +package stonelog + +var ( + stoneTracePrefixes = []string{ + "Science traces", + "Lab sensors detect", + "Microscope focus on", + "Quantum scanner active:", + "Data particles observed:", + } + + stoneDebugPrefixes = []string{ + "Hypothesis forming:", + "Analyzing data patterns:", + "Debugging quantum fluctuations:", + "Lab notes:", + "Testing variables:", + } + + stoneInfoPrefixes = []string{ + "Experiment successful:", + "Lab results:", + "Scientific consensus:", + "Discovery logged:", + "Theory proven:", + } + + stoneWarnPrefixes = []string{ + "Anomaly detected:", + "Risk probability increased:", + "System instability suspected:", + "Contamination warning:", + "Resource depletion imminent:", + } + + stoneErrorPrefixes = []string{ + "Critical malfunction:", + "Lab accident reported:", + "Data corruption confirmed:", + "System collapse:", + "Hypothesis disproven:", + } + + stonePanicPrefixes = []string{ + "¡¡¡CATASTROPHIC FAILURE!!!", + "Emergency protocol FAILED:", + "LEAVE THE LAB!", + "¡¡¡IMMINENT NUCLEAR FUSION!!!", + } +) diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..31737c3 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=b97a45b2-c25d-4fd1-898d-136414896ce6 +sonar.projectName=mother-utils/motherlog +sonar.language=go +sonar.sources=. +sonar.exclusions=**/*_test.go +sonar.tests=. +sonar.test.inclusions=**/*_test.go \ No newline at end of file