trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Neradt <brian.ner...@gmail.com>
Subject Re: [E] Re: [PROPOSAL] TS API for Status,Note,Warning,Alert
Date Tue, 08 Sep 2020 23:13:00 GMT
+1

On Tue, Sep 8, 2020 at 4:00 PM Sudheer Vinukonda <sudheervinukonda@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 <david.calavera@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 <shinrich@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 <acanary@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

Mime
View raw message