 ;; geiser-log.el -- logging utilities
 
-;; Copyright (C) 2009 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the Modified BSD License. You should

(defvar geiser-log--max-buffer-size 32000
  "Maximum size of the Geiser messages log.")

(defvar geiser-log--max-message-size 512
  "Maximum size of individual Geiser log messages.")

(defvar geiser-log--verbose-p t
  "Log level for Geiser messages")

(defvar geiser-log--inhibit-p nil
  "Set this to t to inhibit all log messages")

(defun geiser-log--msg (type &rest args)
  (unless geiser-log--inhibit-p
    (geiser-log--with-buffer
      (goto-char (point-max))
      (insert (geiser--shorten-str (format "\n%s: %s\n" type
                                           (apply 'format args))
                                   geiser-log--max-message-size)))))

(defsubst geiser-log--warn (&rest args)
