Mailing List Archive

LOG line length limit
Hi,

There is a hard-coded line length limit of about 2kbytes for the LOG
messages.
This is most likely the reason why a lot of the output of the mythtv-setup
channel scanner, notably the channel lists, are written directly to stdout
instead of via the LOG system.
The disadvantage of this is that the output sometimes becomes a mess and
that the stdout messages come before the LOG messages that were created
earlier.

To fix this I would like to write all output with LOG messages but with
this I have hit the length limit.

Are there good reasons for the line limit size or is it feasible to replace
the fixed message buffer of 2kbyte with something dynamically allocated?

Thanks,
Klaas.
Re: LOG line length limit [ In reply to ]
On Mon, 2020-03-23 at 18:45 +0100, Klaas de Waal wrote:
> Hi,
>
> There is a hard-coded line length limit of about 2kbytes for the LOG
> messages.
> This is most likely the reason why a lot of the output of the mythtv-
> setup channel scanner, notably the channel lists, are written
> directly to stdout instead of via the LOG system.
> The disadvantage of this is that the output sometimes becomes a mess
> and that the stdout messages come before the LOG messages that were
> created earlier.
>
> To fix this I would like to write all output with LOG messages but
> with this I have hit the length limit.
>
> Are there good reasons for the line limit size or is it feasible to
> replace the fixed message buffer of 2kbyte with something dynamically
> allocated?

Hi Klaus,

I have uncommitted code to convert logging to use QString and
std::string internally instead of fixed length buffers, but I'm still
using some fixed lengths in places. I will work on this code some more
to try and make the log messages can be truly variable length.

David


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: LOG line length limit [ In reply to ]
On Mon, 23 Mar 2020 at 20:01, David Hampton <mythtv@love2code.net> wrote:

> On Mon, 2020-03-23 at 18:45 +0100, Klaas de Waal wrote:
> > Hi,
> >
> > There is a hard-coded line length limit of about 2kbytes for the LOG
> > messages.
> > This is most likely the reason why a lot of the output of the mythtv-
> > setup channel scanner, notably the channel lists, are written
> > directly to stdout instead of via the LOG system.
> > The disadvantage of this is that the output sometimes becomes a mess
> > and that the stdout messages come before the LOG messages that were
> > created earlier.
> >
> > To fix this I would like to write all output with LOG messages but
> > with this I have hit the length limit.
> >
> > Are there good reasons for the line limit size or is it feasible to
> > replace the fixed message buffer of 2kbyte with something dynamically
> > allocated?
>
> Hi Klaus,
>
> I have uncommitted code to convert logging to use QString and
> std::string internally instead of fixed length buffers, but I'm still
> using some fixed lengths in places. I will work on this code some more
> to try and make the log messages can be truly variable length.
>
> David
>
>
> Hi David,

That is good news! Count on me to do the test drive when you have the code
ready.

Thanks,
Klaas.
Re: LOG line length limit [ In reply to ]
On Mon, 23 Mar 2020 at 20:18, Klaas de Waal <klaas.de.waal@gmail.com> wrote:

>
>
> On Mon, 23 Mar 2020 at 20:01, David Hampton <mythtv@love2code.net> wrote:
>
>> On Mon, 2020-03-23 at 18:45 +0100, Klaas de Waal wrote:
>> > Hi,
>> >
>> > There is a hard-coded line length limit of about 2kbytes for the LOG
>> > messages.
>> > This is most likely the reason why a lot of the output of the mythtv-
>> > setup channel scanner, notably the channel lists, are written
>> > directly to stdout instead of via the LOG system.
>> > The disadvantage of this is that the output sometimes becomes a mess
>> > and that the stdout messages come before the LOG messages that were
>> > created earlier.
>> >
>> > To fix this I would like to write all output with LOG messages but
>> > with this I have hit the length limit.
>> >
>> > Are there good reasons for the line limit size or is it feasible to
>> > replace the fixed message buffer of 2kbyte with something dynamically
>> > allocated?
>>
>> Hi Klaus,
>>
>> I have uncommitted code to convert logging to use QString and
>> std::string internally instead of fixed length buffers, but I'm still
>> using some fixed lengths in places. I will work on this code some more
>> to try and make the log messages can be truly variable length.
>>
>
> Hi David,

Have tested this with (of course) the channelscanner output and it works
OK, no size limits found and no other changes observed. Perfect.

Thanks,
Klaas.


>
>>
>