Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: logging in windows environment #450

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 25 additions & 3 deletions _logging/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,42 @@ runs:
using: "composite"
steps:

# -------------------------------- Linux ---------------------------------

- name: "Report error message"
shell: bash
if: ${{ inputs.level == 'ERROR' }}
if: ${{ inputs.level == 'ERROR' && runner.os == 'Linux' }}
run: |
echo -e "\033[1;91m[ERROR]: ${{ inputs.message }}\033[0m"

- name: "Report warning message"
shell: bash
if: ${{ inputs.level == 'WARNING' }}
if: ${{ inputs.level == 'WARNING' && runner.os == 'Linux' }}
run: |
echo -e "\033[1;93m[WARNING]: ${{ inputs.message }}\033[0m"

- name: "Report info message"
shell: bash
if: ${{ inputs.level == 'INFO' }}
if: ${{ inputs.level == 'INFO' && runner.os == 'Linux' }}
run: |
echo -e "\033[1;92m[INFO]: ${{ inputs.message }}\033[0m"

# ------------------------------- Windows --------------------------------

- name: "Report error message"
shell: powershell
if: ${{ inputs.level == 'ERROR' && runner.os == 'Windows' }}
run: |
Write-Host "$([char]27)[91m[ERROR]: ${{ inputs.message }}$([char]27)[0m"

- name: "Report warning message"
shell: powershell
if: ${{ inputs.level == 'WARNING' && runner.os == 'Windows' }}
run: |
Write-Host "$([char]27)[93m[WARNING]: ${{ inputs.message }}$([char]27)[0m"

- name: "Report info message"
shell: powershell
if: ${{ inputs.level == 'INFO' && runner.os == 'Windows' }}
run: |
Write-Host "$([char]27)[92m[INFO]: ${{ inputs.message }}$([char]27)[0m"