avocado icon indicating copy to clipboard operation
avocado copied to clipboard

Internal (avocado.core) log location and finer control

Open clebergnu opened this issue 3 years ago • 6 comments

Currently, as of 7636a812169a0da4902b86a3467818392903d804, Avocado will generate a avocado.core.DEBUG file with everything that is internal debug information.

The current location, right inside the top level of the job results directory, may be confusing to users (even though it matches the --store-logging-stream specifications).

Ideally, logging streams should be controlled at least in tjree other aspects:

  1. the location
  2. the actual on or off status of the logging
  3. disabling the saving of a logging stream in a file without logging it automatically into job.log (the current behavior).

clebergnu avatar Aug 16 '21 19:08 clebergnu

Hi @clebergnu I'm not 100% sure what is the task here.

But what about using logging.config files here? Is that what you are thinking for this problem?

beraldoleal avatar Aug 16 '21 20:08 beraldoleal

Hi @clebergnu I'm not 100% sure what is the task here.

But what about using logging.config files here? Is that what you are thinking for this problem?

See @willianrampazzo comment here. Does that help?

About logging config files, I don't think users would want to create that directly... so I was thinking of avocado doing the configuration based on simpler instructions from the user.

clebergnu avatar Aug 16 '21 21:08 clebergnu

Hi @clebergnu I'm not 100% sure what is the task here. But what about using logging.config files here? Is that what you are thinking for this problem?

See @willianrampazzo comment here. Does that help?

Yes, I saw that before.

About logging config files, I don't think users would want to create that directly... so I was thinking of avocado doing the configuration based on simpler instructions from the user.

I don't see a problem with allowing users to edit those files, the syntax it is pretty common in many Python projects (django, flask, openstack, ...) and also it is a standard INI file. So, maybe, we could provide a basic default config file for logging, where most of users don't have to touch it, but advanced users needing some debugging information would need minor changes there. Or even providing multiple config examples for different use cases (i.e: default, development)

beraldoleal avatar Aug 17 '21 12:08 beraldoleal

Can't this logging already be handled by avocado's configs? There is already plenty of centralized configuration and I don't see the point in adding extra configuration (logging or otherwise) that is detached from it.

pevogam avatar Oct 05 '21 13:10 pevogam

@pevogam, Configuring logging is all about defining formatters, streamers, loggers and namespaces, I don't see a point of creating new config options and files on top the well know Python's logging.config. This is being used by many projects and one big advantages is the learning curve. Python developers and users used to python projects don't have to understand a new syntax to configure they loggers.

beraldoleal avatar Oct 05 '21 17:10 beraldoleal

This might be related to #5177.

beraldoleal avatar Dec 07 '21 11:12 beraldoleal