class Sawmill::Level

Level objects represent logging levels, sometimes known as severities.

A level object has a name and a numeric value. The name controls how the level is represented in a logfile. The value indicates its severity rank compared to other levels.

Levels are organized into groups. Levels are comparable with one another if they are part of the same group.

Attributes

group[R]

The LevelGroup of which this Level is a member

name[R]

The name of the level, as a string.

value[R]

The numeric value of the level.

Public Instance Methods

<=>(obj_) click to toggle source

Compare this level with another level of the same group.

# File lib/sawmill/level.rb, line 70
def <=>(obj_)
  if obj_.respond_to?(:value) && obj_.respond_to?(:group)
    @group == obj_.group ? @value <=> obj_.value : nil
  else
    nil
  end
end
to_s() click to toggle source

Returns the name.

# File lib/sawmill/level.rb, line 80
def to_s
  @name
end