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

20
.github/workflows/ci.yml

@ -46,13 +46,13 @@ jobs:
ac_username: ${{ secrets.AC_USERNAME }} ac_username: ${{ secrets.AC_USERNAME }}
ac_password: ${{ secrets.AC_PASSWORD }} ac_password: ${{ secrets.AC_PASSWORD }}
gh_token: ${{ secrets.GITHUB_TOKEN }} gh_token: ${{ secrets.GITHUB_TOKEN }}
# build_and_push: build_and_push:
# uses: jasongdove/ersatztv/.github/workflows/docker.yml@main uses: jasongdove/ersatztv/.github/workflows/docker.yml@main
# needs: calculate_version needs: calculate_version
# with: with:
# base_version: develop base_version: develop
# info_version: ${{ needs.calculate_version.outputs.git_tag }} info_version: ${{ needs.calculate_version.outputs.git_tag }}
# tag_version: ${{ github.sha }} tag_version: ${{ github.sha }}
# secrets: secrets:
# docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
# docker_hub_access_token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 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/).
- Fix `HLS Segmenter` streaming mode with multiple ffmpeg-based clients - Fix `HLS Segmenter` streaming mode with multiple ffmpeg-based clients
- Jellyfin (web) and TiviMate (Android) were specifically tested - 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 ## [0.3.8-alpha] - 2022-01-23
### Fixed ### Fixed
- Fix issue preventing some versions of ffmpeg (usually 4.4.x) from streaming MPEG-TS (Legacy) channels at all - 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
public static readonly string DatabasePath = Path.Combine(AppDataFolder, "ersatztv.sqlite3"); public static readonly string DatabasePath = Path.Combine(AppDataFolder, "ersatztv.sqlite3");
public static readonly string LogDatabasePath = Path.Combine(AppDataFolder, "logs.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 LegacyImageCacheFolder = Path.Combine(AppDataFolder, "cache", "images");
public static readonly string ResourcesCacheFolder = Path.Combine(AppDataFolder, "cache", "resources"); public static readonly string ResourcesCacheFolder = Path.Combine(AppDataFolder, "cache", "resources");

1
ErsatzTV/Program.cs

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

Loading…
Cancel
Save