Source

mira.cl / mira.core / src / logging.lisp

(in-package :cl-user)

(defpackage :mira.core.logging
  (:use :cl)
  (:import-from :log5
                :defcategory
                :start-sender
                :stream-sender)
  (:export kernel processor channel message security error warning info notice debug setup-logging *log-stream*))

(in-package :mira.core.logging)
(annot:enable-annot-syntax)

(defcategory kernel)
(defcategory processor)
(defcategory channel)
(defcategory message)
(defcategory security)
(defcategory error)
(defcategory warning)
(defcategory info)
(defcategory notice)
(defcategory debug)

(defcategory warning+ (or warning error))
(defcategory all (or kernel processor message security debug notice info warning error))

@export 
(defparameter *log-stream* nil)

@export 
(defun setup-logging ()
  "By default we start a logger that logs to stdout"
  (start-sender 'application
                (stream-sender :location (or *log-stream* *standard-output*))
                :output-spec '(time log5:category log5:message)
                :category-spec '(all)))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.