Browse Source

write text file logs (#600)

pull/601/head
Jason Dove 4 years ago committed by GitHub
parent
commit
9168fd6bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 156
      .github/workflows/artifacts.yml
  2. 20
      .github/workflows/ci.yml
  3. 3
      CHANGELOG.md
  4. 1
      ErsatzTV.Core/FileSystemLayout.cs
  5. 1
      ErsatzTV/Program.cs

156
.github/workflows/artifacts.yml

@ -36,9 +36,9 @@ jobs: @@ -36,9 +36,9 @@ jobs:
- os: macos-latest
kind: macOS
target: osx-x64
# - os: macos-latest
# kind: macOS
# target: osx-arm64
- os: macos-latest
kind: macOS
target: osx-arm64
steps:
- name: Get the sources
uses: actions/checkout@v2
@ -136,78 +136,78 @@ jobs: @@ -136,78 +136,78 @@ jobs:
${{ env.RELEASE_NAME }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}
# build_and_upload:
# name: Build & Upload
# runs-on: ${{ matrix.os }}
# if: contains(github.event.head_commit.message, '[no build]') == false
# strategy:
# matrix:
# include:
# - os: ubuntu-latest
# kind: linux
# target: linux-x64
# - os: ubuntu-latest
# kind: linux
# target: linux-arm
# - os: windows-latest
# kind: windows
# target: win-x64
# steps:
# - name: Get the sources
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
#
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
#
# - name: Clean
# run: dotnet clean --configuration Release && dotnet nuget locals all --clear
#
# - name: Install dependencies
# run: dotnet restore -r "${{ matrix.target}}"
#
# - name: Build
# shell: bash
# run: |
# # Define some variables for things we need
# release_name="ErsatzTV-${{ inputs.release_version }}-${{ matrix.target }}"
# echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV
#
# # Build everything
# dotnet publish ErsatzTV/ErsatzTV.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true
#
# # Pack files
# if [ "${{ matrix.kind }}" == "windows" ]; then
# 7z a -tzip "${release_name}.zip" "./${release_name}/*"
# else
# tar czvf "${release_name}.tar.gz" "$release_name"
# fi
#
# # Delete output directory
# rm -r "$release_name"
# env:
# AC_USERNAME: ${{ secrets.ac_username }}
# AC_PASSWORD: ${{ secrets.ac_password }}
#
# - name: Delete old release assets
# uses: mknejp/delete-release-assets@v1
# with:
# token: ${{ secrets.gh_token }}
# tag: ${{ inputs.release_tag }}
# fail-if-no-assets: false
# assets: |
# *${{ matrix.target }}.zip
# *${{ matrix.target }}.tar.gz
# - name: Publish
# uses: softprops/action-gh-release@v1
# with:
# prerelease: true
# tag_name: ${{ inputs.release_tag }}
# files: |
# ${{ env.RELEASE_NAME }}.zip
# ${{ env.RELEASE_NAME }}.tar.gz
# env:
# GITHUB_TOKEN: ${{ secrets.gh_token }}
build_and_upload:
name: Build & Upload
runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[no build]') == false
strategy:
matrix:
include:
- os: ubuntu-latest
kind: linux
target: linux-x64
- os: ubuntu-latest
kind: linux
target: linux-arm
- os: windows-latest
kind: windows
target: win-x64
steps:
- name: Get the sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Install dependencies
run: dotnet restore -r "${{ matrix.target}}"
- name: Build
shell: bash
run: |
# Define some variables for things we need
release_name="ErsatzTV-${{ inputs.release_version }}-${{ matrix.target }}"
echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV
# Build everything
dotnet publish ErsatzTV/ErsatzTV.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true
# Pack files
if [ "${{ matrix.kind }}" == "windows" ]; then
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
# Delete output directory
rm -r "$release_name"
env:
AC_USERNAME: ${{ secrets.ac_username }}
AC_PASSWORD: ${{ secrets.ac_password }}
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.gh_token }}
tag: ${{ inputs.release_tag }}
fail-if-no-assets: false
assets: |
*${{ matrix.target }}.zip
*${{ matrix.target }}.tar.gz
- name: Publish
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ inputs.release_tag }}
files: |
${{ env.RELEASE_NAME }}.zip
${{ env.RELEASE_NAME }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}

20
.github/workflows/ci.yml

@ -46,13 +46,13 @@ jobs: @@ -46,13 +46,13 @@ jobs:
ac_username: ${{ secrets.AC_USERNAME }}
ac_password: ${{ secrets.AC_PASSWORD }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
# build_and_push:
# uses: jasongdove/ersatztv/.github/workflows/docker.yml@main
# needs: calculate_version
# with:
# base_version: develop
# info_version: ${{ needs.calculate_version.outputs.git_tag }}
# tag_version: ${{ github.sha }}
# secrets:
# docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
# docker_hub_access_token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
build_and_push:
uses: jasongdove/ersatztv/.github/workflows/docker.yml@main
needs: calculate_version
with:
base_version: develop
info_version: ${{ needs.calculate_version.outputs.git_tag }}
tag_version: ${{ github.sha }}
secrets:
docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
docker_hub_access_token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

3
CHANGELOG.md

@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix `HLS Segmenter` streaming mode with multiple ffmpeg-based clients
- Jellyfin (web) and TiviMate (Android) were specifically tested
### Added
- Also write logs to text files in the `logs` config subfolder
## [0.3.8-alpha] - 2022-01-23
### Fixed
- Fix issue preventing some versions of ffmpeg (usually 4.4.x) from streaming MPEG-TS (Legacy) channels at all

1
ErsatzTV.Core/FileSystemLayout.cs

@ -21,6 +21,7 @@ namespace ErsatzTV.Core @@ -21,6 +21,7 @@ namespace ErsatzTV.Core
public static readonly string DatabasePath = Path.Combine(AppDataFolder, "ersatztv.sqlite3");
public static readonly string LogDatabasePath = Path.Combine(AppDataFolder, "logs.sqlite3");
public static readonly string LogFilePath = Path.Combine(AppDataFolder, "logs", "ersatztv.log");
public static readonly string LegacyImageCacheFolder = Path.Combine(AppDataFolder, "cache", "images");
public static readonly string ResourcesCacheFolder = Path.Combine(AppDataFolder, "cache", "resources");

1
ErsatzTV/Program.cs

@ -43,6 +43,7 @@ namespace ErsatzTV @@ -43,6 +43,7 @@ namespace ErsatzTV
.ReadFrom.Configuration(Configuration)
.Enrich.FromLogContext()
.WriteTo.SQLite(FileSystemLayout.LogDatabasePath, retentionPeriod: TimeSpan.FromDays(1))
.WriteTo.File(FileSystemLayout.LogFilePath, rollingInterval: RollingInterval.Day)
.CreateLogger();
try

Loading…
Cancel
Save