Skip to content
This repository was archived by the owner on Mar 3, 2022. It is now read-only.

Convert logger event types from strings to constants #8

@TravisCarden

Description

@TravisCarden

Let's create constants for the logger_event() $type argument instead of passing around magic strings, i.e.:

/**
 * Logger event type -- Count.
 */
define('LOGGER_COUNT', 'count');

/**
 * Logger event type -- Gauge.
 */
define('LOGGER_GAUGE', 'gauge');

/**
 * Logger event type -- Set.
 */
define('LOGGER_SET', 'set');

/**
 * Logger event type -- Time.
 */
define('LOGGER_TIME', 'time');

See watchdog() and watchdog_severity_levels() for usage and documentation examples. watchdog_severity_levels() is a nice pattern. Let's create logger_event_types() and use it for type assertion in logger_event().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions