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(playout): enhance playout logging #1495

Merged
merged 1 commit into from Jan 13, 2022

Conversation

jooola
Copy link
Contributor

@jooola jooola commented Jan 7, 2022

feat(playout): enhance playout logging

Some initial work on modernizing the playout app. This replace any custom logger or
logging based logger with the logging tools from libretime_shared.logging and loguru.

Removed all the thread/function assigned logger (self.logger = ...), as this makes it
part of the logic (passing logger though function args) as it should not.

Of a dedicated logger is required for a specific task, it should use
the create_task_logger function.

  • refactor: remove dead code
  • refactor: remove py2 specific fix
  • feat: remove unused test command
  • feat: setup shared cli and logging tools
  • feat: replace logging with loguru
  • feat: setup shared cli and logging tools for notify
  • fix: warn method deos not exist
  • feat: make cli setup the entrypoint
  • fix: install shared modules globally in production
    use extra_requires to load local packages in dev environement
  • feat: configure log path in systemd service
  • feat: default behavior is to log to console only
  • feat: create log dir during install
  • chore: add comment
  • fix: don't create useless dir in install
  • fix: move notify logs to /var/log/libretime dir
  • fix: update setup_logger attrs
  • style: linting
  • fix: replace verbosity flag with log-level flag
  • feat: use shared logging tool in liquidsoap
  • fix: pass logger down to api client
  • feat: allow custom log_filepath in liquidsoap config
  • chore: add pylintrc to playout
  • refactor: fix pylint errors
  • feat: set liquidsoap log filepath in systemd service
  • fix: missing setup entrypoint update

BREAKING CHANGE: for playout and liquidsoap the default log file path changed to None
and will only log to the console when developing / testing. Unless you are running the
app as a systemd service (production) the default logs filepaths changed:
from "/var/log/airtime/pypo/pypo.log" to "/var/log/libretime/playout.log" and
from "/var/log/airtime/pypo-liquidsoap/ls_script.log" to "/var/log/libretime/liquidsoap.log"

BREAKING CHANGE: for playout-notify the default log file path changed
from "/var/log/airtime/pypo/notify.log" to "/var/log/libretime/playout-notify.log"

@jooola jooola force-pushed the feat/enhance_playout_logging branch 3 times, most recently from 0263b2e to aed946c Compare January 7, 2022 15:54
@jooola jooola marked this pull request as ready for review January 7, 2022 20:26
@jooola jooola force-pushed the feat/enhance_playout_logging branch from eb9f225 to 82de070 Compare January 7, 2022 20:27
@jooola
Copy link
Contributor Author

jooola commented Jan 7, 2022

Depends on #1496

@jooola jooola force-pushed the feat/enhance_playout_logging branch from 81b50f8 to 5584faa Compare January 8, 2022 16:23
@jooola
Copy link
Contributor Author

jooola commented Jan 11, 2022

If this is ready to be merged, I'll squash the PR and test the changelog generation for the breaking notice.

Once this is done this can be merged.

@paddatrapper
Copy link
Contributor

Changes look good. Just need to test in Vagrant before I'm happy to merge

@paddatrapper
Copy link
Contributor

libretime-liquidsoap fails to start with

Jan 12 08:00:19 buster libretime-liquidsoap[1787]:     from libretime_liquidsoap.main import run
Jan 12 08:00:19 buster libretime-liquidsoap[1787]: ImportError: cannot import name 'run' from 'libretime_liquidsoap.main' (/usr/local/lib/python3.7/dist-packages/libretime_liquidsoap/main.py)

@jooola
Copy link
Contributor Author

jooola commented Jan 12, 2022

Ok, sorry for not testing the few last commits, I though I tested it already. I'll push a fix and test it again.

@jooola
Copy link
Contributor Author

jooola commented Jan 12, 2022

Tested the latest changes, everything seems to be working as expected.

I merged the fix in #1506 into this for testing, I'll squash / rebase on master once this is fully reviewed and #1506 is merged in master.

@jooola jooola force-pushed the feat/enhance_playout_logging branch from a50153b to 159ce4a Compare January 13, 2022 01:58
@paddatrapper
Copy link
Contributor

Looks good. I'm happy to merge this when you've squashed/rebased

Some initial work on modernizing the playout app. This replace any custom logger or
logging based logger with the logging tools from libretime_shared.logging and loguru.

Removed all the thread/function assigned logger (self.logger = ...), as this makes it
part of the logic (passing logger though function args) as it should not.

Of a dedicated logger is required for a specific task, it should use
the create_task_logger function.

- refactor: remove dead code
- refactor: remove py2 specific fix
- feat: remove unused test command
- feat: setup shared cli and logging tools
- feat: replace logging with loguru
- feat: setup shared cli and logging tools for notify
- fix: warn method deos not exist
- feat: make cli setup the entrypoint
- fix: install shared modules globally in production
  use extra_requires to load local packages in dev environement
- feat: configure log path in systemd service
- feat: default behavior is to log to console only
- feat: create log dir during install
- chore: add comment
- fix: don't create useless dir in install
- fix: move notify logs to /var/log/libretime dir
- fix: update setup_logger attrs
- style: linting
- fix: replace verbosity flag with log-level flag
- feat: use shared logging tool in liquidsoap
- fix: pass logger down to api client
- feat: allow custom log_filepath in liquidsoap config
- chore: add pylintrc to playout
- refactor: fix pylint errors
- feat: set liquidsoap log filepath in systemd service
- fix: missing setup entrypoint update

BREAKING CHANGE: for playout and liquidsoap the default log file path changed to None
and will only log to the console when developing / testing. Unless you are running the
app as a systemd service (production) the default logs filepaths changed:
from "/var/log/airtime/pypo/pypo.log" to "/var/log/libretime/playout.log" and
from "/var/log/airtime/pypo-liquidsoap/ls_script.log" to "/var/log/libretime/liquidsoap.log"

BREAKING CHANGE: for playout-notify the default log file path changed
from "/var/log/airtime/pypo/notify.log" to "/var/log/libretime/playout-notify.log"
@jooola jooola force-pushed the feat/enhance_playout_logging branch from 159ce4a to 2728518 Compare January 13, 2022 14:52
@jooola
Copy link
Contributor Author

jooola commented Jan 13, 2022

Ok, this can be merged, but the small tests I made using git-chlog didn't generate exaclty what I expected, but they provide a changelog template we can tweak for our needs.

It appears to be a bug git-chglog/git-chglog#148

@paddatrapper paddatrapper merged commit 5c72f71 into libretime:master Jan 13, 2022
@jooola jooola deleted the feat/enhance_playout_logging branch January 13, 2022 15:19
@github-actions github-actions bot mentioned this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants