You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Aaron Canary <ac...@verizonmedia.com.INVALID> on 2020/09/08 17:04:35 UTC

[PROPOSAL] TS API for Status,Note,Warning,Alert

I'd like to propose adding API calls for the remaining methods in diag.h:
TSStatus(const char *fmt, ...) // prints to diags log (informational)
TSNote(const char *fmt, ...) // prints to diags log (implies significance)
TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
TSAlert(const char *fmt, ...) // exit and restart, prints to diags
log (implies needs attention)

The following are already exposed through the API:
TSDebug(const char* tag, const char *fmt, ...) // print to stderr
TSError(const char *fmt, ...) // prints to diags log (implies operation
failure, causes test fail in CI)
TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
diags log

I'd like to add these to the TS API, and update the documentation to
directly describe the uses of each. I'm not interested in changing any
functionality of diags.h/.cc at the moment, just exposing for plugins to
use.

Corrections? Major objections or concerns?
I'll reply here with the PR when it's ready. That might be a better forum
to discuss the details.

Re: [E] Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Walt Karas <wk...@verizonmedia.com.INVALID>.
+1

On Wed, Sep 9, 2020 at 11:57 AM Bryan Call <bc...@apache.org> wrote:

> +1
>
> -Bryan
>
>
> > On Sep 8, 2020, at 10:04 AM, Aaron Canary <ac...@verizonmedia.com>
> wrote:
> >
> > I'd like to propose adding API calls for the remaining methods in diag.h:
> > TSStatus(const char *fmt, ...) // prints to diags log (informational)
> > TSNote(const char *fmt, ...) // prints to diags log (implies
> significance)
> > TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
> > TSAlert(const char *fmt, ...) // exit and restart, prints to diags log
> (implies needs attention)
> >
> > The following are already exposed through the API:
> > TSDebug(const char* tag, const char *fmt, ...) // print to stderr
> > TSError(const char *fmt, ...) // prints to diags log (implies operation
> failure, causes test fail in CI)
> > TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
> > TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
> diags log
> >
> > I'd like to add these to the TS API, and update the documentation to
> directly describe the uses of each. I'm not interested in changing any
> functionality of diags.h/.cc at the moment, just exposing for plugins to
> use.
> >
> > Corrections? Major objections or concerns?
> > I'll reply here with the PR when it's ready. That might be a better
> forum to discuss the details.
>
>

Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Bryan Call <bc...@apache.org>.
+1

-Bryan


> On Sep 8, 2020, at 10:04 AM, Aaron Canary <ac...@verizonmedia.com> wrote:
> 
> I'd like to propose adding API calls for the remaining methods in diag.h:
> TSStatus(const char *fmt, ...) // prints to diags log (informational)
> TSNote(const char *fmt, ...) // prints to diags log (implies significance)
> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
> TSAlert(const char *fmt, ...) // exit and restart, prints to diags log (implies needs attention)
> 
> The following are already exposed through the API:
> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
> TSError(const char *fmt, ...) // prints to diags log (implies operation failure, causes test fail in CI)
> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to diags log
> 
> I'd like to add these to the TS API, and update the documentation to directly describe the uses of each. I'm not interested in changing any functionality of diags.h/.cc at the moment, just exposing for plugins to use.
> 
> Corrections? Major objections or concerns? 
> I'll reply here with the PR when it's ready. That might be a better forum to discuss the details. 


Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Bryan Call <bc...@apache.org>.
+1

-Bryan


> On Sep 8, 2020, at 10:04 AM, Aaron Canary <ac...@verizonmedia.com> wrote:
> 
> I'd like to propose adding API calls for the remaining methods in diag.h:
> TSStatus(const char *fmt, ...) // prints to diags log (informational)
> TSNote(const char *fmt, ...) // prints to diags log (implies significance)
> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
> TSAlert(const char *fmt, ...) // exit and restart, prints to diags log (implies needs attention)
> 
> The following are already exposed through the API:
> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
> TSError(const char *fmt, ...) // prints to diags log (implies operation failure, causes test fail in CI)
> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to diags log
> 
> I'd like to add these to the TS API, and update the documentation to directly describe the uses of each. I'm not interested in changing any functionality of diags.h/.cc at the moment, just exposing for plugins to use.
> 
> Corrections? Major objections or concerns? 
> I'll reply here with the PR when it's ready. That might be a better forum to discuss the details. 


Re: [E] Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Brian Neradt <br...@gmail.com>.
+1

On Tue, Sep 8, 2020 at 4:00 PM Sudheer Vinukonda <su...@yahoo.com>
wrote:

> Generally +1 on exposing the API, but, just wondering if there is a
> possibility that we can write a single API that takes the log type as an
> input instead of having to clone a new API for each log type?
>
> Thanks,
>
> Sudheer
>
>
>
> On Tuesday, September 8, 2020, 01:31:50 PM PDT, Aaron Canary <
> acanary@verizonmedia.com> wrote:
>
>
> @Calavera I asked those same questions. I believe we are just mapping
> 1-to-1 with syslogd. I plan to add documentation and comments to express
> the difference between the levels.
>
> #define LOG_EMERG 0 /* system is unusable */
> #define LOG_ALERT 1 /* action must be taken immediately */
> #define LOG_CRIT 2 /* critical conditions */
> #define LOG_ERR 3 /* error conditions */
> #define LOG_WARNING 4 /* warning conditions */
> #define LOG_NOTICE 5 /* normal but significant condition */
>
> #define LOG_INFO 6 /* informational */
>
> #define LOG_DEBUG 7 /* debug-level messages */
>
>
> On Tue, Sep 8, 2020 at 3:22 PM David Calavera <da...@gmail.com>
> wrote:
>
> TSDebug has a variant, `TSDebugSpecific` that people can use to enable
> debugging on demand. Should those new methods have the same variant?
>
> Is the difference between `TSStatus` and `TSNote` significant enough to
> require two methods? I would expect the logging api to be consistent with
> other standard logging apis, and it might make more sense to follow known
> log levels (debug, info, warning, error, fatal) than creating new ones with
> small nuances in meaning.
>
> What do you think?
>
> On Tue, Sep 8, 2020 at 12:38 PM Susan Hinrichs <sh...@verizonmedia.com>
> wrote:
>
> +1
>
> On Tue, Sep 8, 2020 at 1:34 PM Alan Carroll <
> solidwallofcode@verizonmedia.com> wrote:
>
> +1.
>
> On Tue, Sep 8, 2020 at 12:04 PM Aaron Canary <ac...@verizonmedia.com>
> wrote:
>
> I'd like to propose adding API calls for the remaining methods in diag.h:
> TSStatus(const char *fmt, ...) // prints to diags log (informational)
> TSNote(const char *fmt, ...) // prints to diags log (implies significance)
> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
> TSAlert(const char *fmt, ...) // exit and restart, prints to diags
> log (implies needs attention)
>
> The following are already exposed through the API:
> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
> TSError(const char *fmt, ...) // prints to diags log (implies operation
> failure, causes test fail in CI)
> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
> diags log
>
> I'd like to add these to the TS API, and update the documentation to
> directly describe the uses of each. I'm not interested in changing any
> functionality of diags.h/.cc at the moment, just exposing for plugins to
> use.
>
> Corrections? Major objections or concerns?
> I'll reply here with the PR when it's ready. That might be a better forum
> to discuss the details.
>
>

-- 
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."

    ~ Matthew 11:28-30

Re: [E] Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Sudheer Vinukonda <su...@yahoo.com>.
 Generally +1 on exposing the API, but, just wondering if there is a possibility that we can write a single API that takes the log type as an input instead of having to clone a new API for each log type?
Thanks,
Sudheer


    On Tuesday, September 8, 2020, 01:31:50 PM PDT, Aaron Canary <ac...@verizonmedia.com> wrote:  
 
 @Calavera I asked those same questions. I believe we are just mapping 1-to-1 with syslogd. I plan to add documentation and comments to express the difference between the levels.
#define LOG_EMERG 0 /* system is unusable */#define LOG_ALERT 1 /* action must be taken immediately */#define LOG_CRIT 2 /* critical conditions */#define LOG_ERR 3 /* error conditions */#define LOG_WARNING 4 /* warning conditions */#define LOG_NOTICE 5 /* normal but significant condition */

#define LOG_INFO 6 /* informational */

#define LOG_DEBUG 7 /* debug-level messages */


On Tue, Sep 8, 2020 at 3:22 PM David Calavera <da...@gmail.com> wrote:

TSDebug has a variant, `TSDebugSpecific` that people can use to enable debugging on demand. Should those new methods have the same variant?

Is the difference between `TSStatus` and `TSNote` significant enough to require two methods? I would expect the logging api to be consistent with other standard logging apis, and it might make more sense to follow known log levels (debug, info, warning, error, fatal) than creating new ones with small nuances in meaning.
What do you think?

On Tue, Sep 8, 2020 at 12:38 PM Susan Hinrichs <sh...@verizonmedia.com> wrote:

+1

On Tue, Sep 8, 2020 at 1:34 PM Alan Carroll <so...@verizonmedia.com> wrote:

+1.

On Tue, Sep 8, 2020 at 12:04 PM Aaron Canary <ac...@verizonmedia.com> wrote:

I'd like to propose adding API calls for the remaining methods in diag.h:TSStatus(const char *fmt, ...) // prints to diags log (informational)
TSNote(const char *fmt, ...) // prints to diags log (implies significance)TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
TSAlert(const char *fmt, ...) // exit and restart, prints to diags log (implies needs attention)

The following are already exposed through the API:TSDebug(const char* tag, const char *fmt, ...) // print to stderrTSError(const char *fmt, ...) // prints to diags log (implies operation failure, causes test fail in CI)
TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to diags log

I'd like to add these to the TS API, and update the documentation to directly describe the uses of each. I'm not interested in changing any functionality of diags.h/.cc at the moment, just exposing for plugins to use.
Corrections? Major objections or concerns? I'll reply here with the PR when it's ready. That might be a better forum to discuss the details. 



  

Re: [E] Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Aaron Canary <ac...@verizonmedia.com>.
@Calavera I asked those same questions. I believe we are just mapping
1-to-1 with syslogd. I plan to add documentation and comments to express
the difference between the levels.

#define LOG_EMERG 0 /* system is unusable */
#define LOG_ALERT 1 /* action must be taken immediately */
#define LOG_CRIT 2 /* critical conditions */
#define LOG_ERR 3 /* error conditions */
#define LOG_WARNING 4 /* warning conditions */
#define LOG_NOTICE 5 /* normal but significant condition */

#define LOG_INFO 6 /* informational */

#define LOG_DEBUG 7 /* debug-level messages */


On Tue, Sep 8, 2020 at 3:22 PM David Calavera <da...@gmail.com>
wrote:

> TSDebug has a variant, `TSDebugSpecific` that people can use to enable
> debugging on demand. Should those new methods have the same variant?
>
> Is the difference between `TSStatus` and `TSNote` significant enough to
> require two methods? I would expect the logging api to be consistent with
> other standard logging apis, and it might make more sense to follow known
> log levels (debug, info, warning, error, fatal) than creating new ones with
> small nuances in meaning.
>
> What do you think?
>
> On Tue, Sep 8, 2020 at 12:38 PM Susan Hinrichs <sh...@verizonmedia.com>
> wrote:
>
>> +1
>>
>> On Tue, Sep 8, 2020 at 1:34 PM Alan Carroll <
>> solidwallofcode@verizonmedia.com> wrote:
>>
>>> +1.
>>>
>>> On Tue, Sep 8, 2020 at 12:04 PM Aaron Canary <ac...@verizonmedia.com>
>>> wrote:
>>>
>>>> I'd like to propose adding API calls for the remaining methods in
>>>> diag.h:
>>>> TSStatus(const char *fmt, ...) // prints to diags log (informational)
>>>> TSNote(const char *fmt, ...) // prints to diags log (implies
>>>> significance)
>>>> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
>>>> TSAlert(const char *fmt, ...) // exit and restart, prints to diags
>>>> log (implies needs attention)
>>>>
>>>> The following are already exposed through the API:
>>>> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
>>>> TSError(const char *fmt, ...) // prints to diags log (implies operation
>>>> failure, causes test fail in CI)
>>>> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
>>>> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
>>>> diags log
>>>>
>>>> I'd like to add these to the TS API, and update the documentation to
>>>> directly describe the uses of each. I'm not interested in changing any
>>>> functionality of diags.h/.cc at the moment, just exposing for plugins to
>>>> use.
>>>>
>>>> Corrections? Major objections or concerns?
>>>> I'll reply here with the PR when it's ready. That might be a better
>>>> forum to discuss the details.
>>>>
>>>

Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by David Calavera <da...@gmail.com>.
TSDebug has a variant, `TSDebugSpecific` that people can use to enable
debugging on demand. Should those new methods have the same variant?

Is the difference between `TSStatus` and `TSNote` significant enough to
require two methods? I would expect the logging api to be consistent with
other standard logging apis, and it might make more sense to follow known
log levels (debug, info, warning, error, fatal) than creating new ones with
small nuances in meaning.

What do you think?

On Tue, Sep 8, 2020 at 12:38 PM Susan Hinrichs <sh...@verizonmedia.com>
wrote:

> +1
>
> On Tue, Sep 8, 2020 at 1:34 PM Alan Carroll <
> solidwallofcode@verizonmedia.com> wrote:
>
>> +1.
>>
>> On Tue, Sep 8, 2020 at 12:04 PM Aaron Canary <ac...@verizonmedia.com>
>> wrote:
>>
>>> I'd like to propose adding API calls for the remaining methods in diag.h:
>>> TSStatus(const char *fmt, ...) // prints to diags log (informational)
>>> TSNote(const char *fmt, ...) // prints to diags log (implies
>>> significance)
>>> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
>>> TSAlert(const char *fmt, ...) // exit and restart, prints to diags
>>> log (implies needs attention)
>>>
>>> The following are already exposed through the API:
>>> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
>>> TSError(const char *fmt, ...) // prints to diags log (implies operation
>>> failure, causes test fail in CI)
>>> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
>>> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
>>> diags log
>>>
>>> I'd like to add these to the TS API, and update the documentation to
>>> directly describe the uses of each. I'm not interested in changing any
>>> functionality of diags.h/.cc at the moment, just exposing for plugins to
>>> use.
>>>
>>> Corrections? Major objections or concerns?
>>> I'll reply here with the PR when it's ready. That might be a better
>>> forum to discuss the details.
>>>
>>

Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Susan Hinrichs <sh...@verizonmedia.com>.
+1

On Tue, Sep 8, 2020 at 1:34 PM Alan Carroll <
solidwallofcode@verizonmedia.com> wrote:

> +1.
>
> On Tue, Sep 8, 2020 at 12:04 PM Aaron Canary <ac...@verizonmedia.com>
> wrote:
>
>> I'd like to propose adding API calls for the remaining methods in diag.h:
>> TSStatus(const char *fmt, ...) // prints to diags log (informational)
>> TSNote(const char *fmt, ...) // prints to diags log (implies significance)
>> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
>> TSAlert(const char *fmt, ...) // exit and restart, prints to diags
>> log (implies needs attention)
>>
>> The following are already exposed through the API:
>> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
>> TSError(const char *fmt, ...) // prints to diags log (implies operation
>> failure, causes test fail in CI)
>> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
>> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
>> diags log
>>
>> I'd like to add these to the TS API, and update the documentation to
>> directly describe the uses of each. I'm not interested in changing any
>> functionality of diags.h/.cc at the moment, just exposing for plugins to
>> use.
>>
>> Corrections? Major objections or concerns?
>> I'll reply here with the PR when it's ready. That might be a better forum
>> to discuss the details.
>>
>

Re: [PROPOSAL] TS API for Status,Note,Warning,Alert

Posted by Alan Carroll <so...@verizonmedia.com>.
+1.

On Tue, Sep 8, 2020 at 12:04 PM Aaron Canary <ac...@verizonmedia.com>
wrote:

> I'd like to propose adding API calls for the remaining methods in diag.h:
> TSStatus(const char *fmt, ...) // prints to diags log (informational)
> TSNote(const char *fmt, ...) // prints to diags log (implies significance)
> TSWarning(const char *fmt, ...) // prints to diags log (implies concern)
> TSAlert(const char *fmt, ...) // exit and restart, prints to diags
> log (implies needs attention)
>
> The following are already exposed through the API:
> TSDebug(const char* tag, const char *fmt, ...) // print to stderr
> TSError(const char *fmt, ...) // prints to diags log (implies operation
> failure, causes test fail in CI)
> TSFatal(const char *fmt, ...) // exit and restart, prints to diags log
> TSEmergeny(const char *fmt, ...). // exit and don't restart, prints to
> diags log
>
> I'd like to add these to the TS API, and update the documentation to
> directly describe the uses of each. I'm not interested in changing any
> functionality of diags.h/.cc at the moment, just exposing for plugins to
> use.
>
> Corrections? Major objections or concerns?
> I'll reply here with the PR when it's ready. That might be a better forum
> to discuss the details.
>