tmux-plugins / tmux-logging

Easy logging and screen capturing for Tmux.
MIT License
1.03k stars 113 forks source link

logging output path #19

Open selfuryon opened 6 years ago

selfuryon commented 6 years ago

Hello! I found some configurable variables in this package. This is really helpful! But I found that path in this variables should exist before you can drop off the logs by this path. It will be really fine if I can only specify the full path like "%Y-%m-%d/#{session_name}.log" without manual creating "%Y-%m-%d" folders. Can you make it?

selfuryon commented 6 years ago

Right now I use this configuration:

set -g @logging-path '$HOME/logs'
set -g @logging-filename "%Y-%m-%d_#{session_name}-#{window_index}-#{pane_index}.log"

But I should create logs folder manually. And I just want to use config like this:

set -g @logging-path '$HOME/logs/%Y-%m-%d'
set -g @logging-filename "#{session_name}-#{window_index}-#{pane_index}.log"
selfuryon commented 6 years ago

I have found that variables which used are not expanded. Example in my config will be like "$HOME/logs/%Y-%m-%d" not like "/home/user/logs/2017-12-07". So the simple try to add after this sentence only mkdir -p "${logging_path}" doesn't work =\ and eval "$logging_path" works only for $HOME not for "%Н-%m-%d"

bruno- commented 6 years ago

Hey,

I'd accept a PR for this feature.

selfuryon commented 6 years ago

Ok, I will try to add this feature and after I make PR.

selfuryon commented 6 years ago

I have just added new PR #20

selfuryon commented 6 years ago

Can anyone check my PR? :) It's very simple