File: debug.rb

package info (click to toggle)
ruby-graffiti 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 412 kB
  • sloc: ruby: 2,488; sql: 209; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Graffiti RDF Store
# (originally written for Samizdat project)
#
#   Copyright (c) 2002-2011  Dmitry Borodaenko <angdraug@debian.org>
#
#   This program is free software.
#   You can distribute/modify this program under the terms of
#   the GNU General Public License version 3 or later.
#
# see doc/rdf-storage.txt for introduction and Graffiti Squish definition;
# see doc/storage-impl.txt for explanation of implemented algorithms
#
# vim: et sw=2 sts=2 ts=8 tw=0

module Graffiti

module Debug
  private

  DEBUG = false

  def debug(message = nil)
    return unless DEBUG

    message = yield if block_given?
    log message if message
  end

  def log(message)
    STDERR << 'Graffiti: ' << message.to_s << "\n"
  end
end

end