Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#11992 closed Patch - Bug Fix (fixed)

Patch: Prevent an invalid combination of logging options and adjust the --help output

Reported by: Bill Meek <keemllib@…> Owned by: Bill Meek
Priority: minor Milestone: 0.28
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

According to mythAnyCommand --help nologserver (changeset:f124159):

Description: Disable all logging but console.

However, the three options in the above Summary are allowed. If used, then mythlogserver is started, however nothing is sent to the logs or the database (only the console, as expected.)

This patch will prevent the invalid combination and cause the following to be added to --help nologserver output:

Prevents the use of:
 --logpath --syslog --enable-dblog

Attachments (1)

nologserver.patch.0 (677 bytes) - added by Bill Meek <keemllib@…> 6 years ago.
Patch tested on: v0.28-pre-655-g7f3d8f7

Download all attachments as: .zip

Change History (15)

Changed 6 years ago by Bill Meek <keemllib@…>

Attachment: nologserver.patch.0 added

Patch tested on: v0.28-pre-655-g7f3d8f7

comment:1 Changed 5 years ago by Bill Meek <keemllib@…>

Owner: set to Bill Meek <keemllib@…>
Resolution: fixed
Status: newclosed

In be72636b9e34b1b9fb032a1da578a742d562d0b9/mythtv:

Prevent --syslog, --logpath and --enable-dblog if --nologserver is used

Fixes #11992.

Signed-off-by: Paul Harrison <pharrison@…>

comment:2 Changed 5 years ago by Bill Meek <keemllib@…>

In ec06dfba8e22008ac97af81f997e9b521eca62ae/mythtv:

Prevent --syslog, --logpath and --enable-dblog if --nologserver is used

Fixes #11992.

Signed-off-by: Paul Harrison <pharrison@…>
(cherry picked from commit be72636b9e34b1b9fb032a1da578a742d562d0b9)

comment:3 Changed 5 years ago by paulh

Milestone: unknown0.27.5

comment:4 Changed 5 years ago by JYA

Resolution: fixed
Status: closednew

this ticket and description is wrong.

--nologserver prevent that a mythlogserver daemon is forked and run in the background.

Instead, logs are processed within a separate thread which log all the logs.

running a myth application with --nologserver is identical to compiling mythtv with --disable-mythlogserver

except of course , should people want to, they can still run mythlogserver daemon

comment:5 Changed 5 years ago by JYA

IMHO, the bug is in the description of what --nologserver is supposed to do.

comment:6 Changed 5 years ago by Paul Harrison <pharrison@…>

In 9a72d02cb7e9a89135b5044e9179f148a45b0cf6/mythtv:

Revert "Prevent --syslog, --logpath and --enable-dblog if --nologserver is used"

Seems those options are valid for --nologserver. That option just means don't run
the external mythlogserver but do the logging internally.

Refs #11992.

This reverts commit ec06dfba8e22008ac97af81f997e9b521eca62ae.

comment:7 Changed 5 years ago by Bill Meek <keemllib@…>

If memory serves, the reason I wrote the ticket was that someone on -users (list or channel) was using --nologserver and wasn't getting one of the other forms of logging. [Which they shouldn't expect because logging only goes to the console.]

I haven't seen any reports of users not getting logs since then. I would suggest the fix is valid based on the commit cited on the 1st line of the initial description (changeset:f124159.)

comment:8 Changed 4 years ago by Stuart Auchterlonie

Milestone: 0.27.50.27.6

comment:9 Changed 4 years ago by Bill Meek <keemllib@…>

For additional history regarding the initial revert, please see the logs at 13:11:44 here:

irc.mythtv.org/ircLog/channel/4/2014-11-19

comment:10 Changed 4 years ago by Karl Egly

Owner: changed from Bill Meek <keemllib@…> to JYA
Status: newassigned

Convenience link to the chat log: http://irc.mythtv.org/ircLog/channel/4/2014-11-19:12:49:52/2014-11-19:13:13:44

Jya, can you clarify the intention of --nologserver? Your comment when reopening and your documentation of the option in the source code say different things. I'm tempted to let the documentation describe the implementation as it is now. Although I'm not sure how the implementation is now :)

https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/mythcommandlineparser.cpp#L2436

add("--nologserver", "nologserver", false, "Disable all logging but console.", "")
            ->SetGroup("Logging");

comment:11 Changed 4 years ago by Bill Meek <keemllib@…>

Suggest a 0.28 milestone because implementing it now could prevent 0.27 user's backends from starting (if they have incorrect flags.)

I'll add it to the 0.28 release notes if fixed.

comment:12 in reply to:  10 Changed 4 years ago by JYA

Replying to dekarl:

Convenience link to the chat log: http://irc.mythtv.org/ircLog/channel/4/2014-11-19:12:49:52/2014-11-19:13:13:44

Jya, can you clarify the intention of --nologserver? Your comment when reopening and your documentation of the option in the source code say different things. I'm tempted to let the documentation describe the implementation as it is now. Although I'm not sure how the implementation is now :)

did I add that option?

maybe easiest would be to rename that argument, because right now it's super confusing.

comment:13 Changed 4 years ago by Bill Meek <bmeek@…>

Resolution: fixed
Status: assignedclosed

In ac415356601a0122b2c0c6cd6df0f265a8afe744/mythtv:

Logging: Rename --nologserver, prevent invalid options

  1. Rename the --nologserver switch --disable-mythlogserver. Hopefully that's more meaningful.
  1. If the --enable-mythlogserver switch was used with ./configure, then display the --disable-mythlogserver switch for any MythTV program's --help. Also, prevent --syslog, --logpath and --enable-dblog because with mythlogserver disabled, logging only goes to the console. I only verified this with --logpath and no file was created under the directory passed to it.
  1. If --enable-mythlogserver wasn't used, then don't even display the --disable-mythlogserver switch when --help is requested and fire an error if it is used. This is the normal/recommended/ high-runner case. --syslog --logpath and --enable-dblog work as expected.

Closes #11992

comment:14 Changed 4 years ago by Bill Meek

Milestone: 0.27.60.28
Owner: changed from JYA to Bill Meek
Summary: Patch: Prevent --syslog, --logpath and --enable-dblog if --nologserver is usedPatch: Prevent an invalid combination of logging options and adjust the --help output
Note: See TracTickets for help on using tickets.