module GLib::Log - glib2-3.1.1 Documentation

# module GLib::Log

### Constants

DOMAIN
LEVELS

### Public Instance Methods

critical(str) click to toggle source

    # File lib/glib2.rb, line 206
    def critical(str)
      log(DOMAIN, LEVEL_CRITICAL, caller(1)[0] << ": " << str)
    end

error(str) click to toggle source

    # File lib/glib2.rb, line 200
    def error(str)
      log(DOMAIN, LEVEL_ERROR, caller(1)[0] << ": " << str)
    end

message(str) click to toggle source

    # File lib/glib2.rb, line 203
    def message(str)
      log(DOMAIN, LEVEL_MESSAGE, caller(1)[0] << ": " << str)
    end

set_log_domain(domain) click to toggle source

    # File lib/glib2.rb, line 213
    def set_log_domain(domain)
      level =
        FLAG_RECURSION |
        FLAG_FATAL |
        LEVEL_ERROR |
        LEVEL_CRITICAL |
        LEVEL_WARNING
      if $VERBOSE or $DEBUG
        level |=
          LEVEL_MESSAGE |
          LEVEL_INFO
      end
      if $DEBUG
        level |= LEVEL_DEBUG
      end
      GLib::Log.set_handler(domain, level)
    end

warning(str) click to toggle source

    # File lib/glib2.rb, line 209
    def warning(str)
      log(DOMAIN, LEVEL_WARNING, caller(1)[0] << ": " << str)
    end