byu-animation / dccpipe

Open DCC Pipeline management tools
Apache License 2.0
10 stars 4 forks source link

Implement logging #42

Open mswindler opened 5 years ago

mswindler commented 5 years ago

Very low priority, but would be a great addition.

mswindler commented 5 years ago

loguru would be a nice module to use, but it is not installed on the computers so we'd need to get sudo privileges to install it.

But we could do it manually with a Logger class that handles the formatting of each message and prints it to a project log file.

Steps to implement:

1

We'd want to add a logs directory to the production folder, or maybe just inside dccpipe. It would be gitignored.

Then we'd probably have methods for:

that would each call a parent method that handles formatting of the actual message (i.e. adding timestamp, user, etc.)

2

We'd want to add try/except blocks inside basically all(?) methods and in the excepts we would catch the error and print it to the log file (additionally showing a message to user).

3

In existing if/else blocks for error-checking we may want to add some logging too.