Skip to content

Commit

Permalink
Merge pull request 7max#27 from sharplispers/cleanup
Browse files Browse the repository at this point in the history
Cleanup: improve asd files, move sources, fix typos, whitespace cleanup etc
  • Loading branch information
dkochmanski authored Sep 23, 2018
2 parents 6a857b0 + 91b55ff commit 3037934
Show file tree
Hide file tree
Showing 14 changed files with 278 additions and 303 deletions.
12 changes: 4 additions & 8 deletions log4cl-examples.asd
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
;;; See the License for the specific language governing permissions and
;;; limitations under the License.

(asdf:defsystem #:log4cl-examples
:version "1.1.2"
:depends-on (#:log4cl #:swank)
:components ((:file "examples/naming-examples")
(asdf:defsystem "log4cl-examples"
:version "1.1.3"
:depends-on ("log4cl" "swank")
:components ((:file "examples/naming-examples")
(:file "examples/customize-log-expr")))




96 changes: 53 additions & 43 deletions log4cl.asd
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,71 @@
;;; See the License for the specific language governing permissions and
;;; limitations under the License.

(defpackage :log4cl.system
(:use #:cl #:asdf))

(in-package :log4cl.system)

(defsystem :log4cl
(asdf:defsystem "log4cl"
:version "1.1.3"
:depends-on (:bordeaux-threads
#+sbcl :sb-posix)
:components
((module "src" :serial t
:components ((:file "impl-package")
(:file "defs")
(:file "naming")
#+sbcl (:file "naming-sbcl")
#+ccl (:file "naming-ccl")
(:file "appender-base")
(:file "hierarchy-base")
(:file "hierarchy")
(:file "logger")
(:file "logging-macros")
(:file "self-logger")
(:file "layout")
(:file "simple-layout")
(:file "pattern-layout")
(:file "appender")
(:file "watcher")
(:file "configurator")
(:file "property-parser")
(:file "property-configurator")
(:file "package"))))
:in-order-to ((test-op (test-op :log4cl/test))))
:depends-on ("bordeaux-threads"
#+sbcl "sb-posix") ; for SB-POSIX:GETPID in pattern-layout.lisp
:components ((:module "src"
:serial t
:components ((:file "impl-package")
(:file "defs")
(:file "naming")
#+sbcl (:file "naming-sbcl")
#+ccl (:file "naming-ccl")
(:file "hierarchy-base")
(:file "hierarchy")
(:file "logger")
(:file "logging-macros")
(:file "self-logger")))
(:module "appender"
:pathname "src/appender"
:depends-on ("src")
:serial t
:components ((:file "layout")
(:file "simple-layout")
(:file "pattern-layout")

(:file "appender-base")
(:file "appender")))
(:module "configuration"
:pathname "src"
:depends-on ("src" "appender")
:serial t
:components ((:file "configurator")
(:file "property-parser")
(:file "property-configurator")))
(:module "watcher"
:pathname "src"
:depends-on ("src" "appender")
:components ((:file "watcher")))
(:module "client-package"
:pathname "src"
:depends-on ("src" "configuration")
:components ((:file "package"))))
:in-order-to ((test-op (test-op "log4cl/test"))))

(defmethod perform :after ((op load-op) (system (eql (find-system :log4cl))))
(when (find-package :log4cl)
(let ((*package* (find-package :log4cl))
(foo (find-symbol (symbol-name '#:%fix-root-logger-check)
(find-package :log4cl))))
(when foo
(funcall foo))))
(defmethod perform :after ((op load-op) (system (eql (find-system "log4cl"))))
(let ((package (find-package '#:log4cl)))
(when package
(let ((*package* package)
(foo (find-symbol (symbol-name '#:%fix-root-logger-check))))
(when foo
(funcall foo)))))
(values))

(defsystem :log4cl/syslog
(asdf:defsystem "log4cl/syslog"
:version "1.1.3"
:depends-on (:log4cl
#-sbcl :cl-syslog)
:depends-on ("log4cl"
#-sbcl "cl-syslog")
:components ((:module "src"
:serial t
:components ((:file "syslog-appender")
#+sbcl (:file "syslog-appender-sbcl")
#-sbcl (:file "syslog-appender-cffi")))))

(defsystem :log4cl/test
(asdf:defsystem "log4cl/test"
:version "1.1.3"
:depends-on (:log4cl :stefil)
:depends-on ("log4cl" "stefil")
:components ((:module "tests"
:serial t
:components ((:file "test-defs")
Expand Down
10 changes: 3 additions & 7 deletions log4slime.asd
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
;;; See the License for the specific language governing permissions and
;;; limitations under the License.

(asdf:defsystem #:log4slime
:version "1.1.2"
:depends-on (#:log4cl #:swank)
(asdf:defsystem "log4slime"
:version "1.1.3"
:depends-on ("log4cl" "swank")
:components ((:file "src/log4slime")))




5 changes: 3 additions & 2 deletions src/appender-base.lisp → src/appender/appender-base.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ opened."))
(:documentation "Called from SAVE-HOOKS, must close appenders that
own their stream in a such way, so its possible to reopen them"))


(defgeneric appender-do-append (appender logger level log-func)
(:documentation
"Writes the log message into the appender. Text of the log message
Expand Down Expand Up @@ -137,7 +138,7 @@ Type | Description
------------------------|------------------------------------------------------
NUMBER or :NUMBER | Integer property, converted by (parse-integer)
------------------------|------------------------------------------------------
BOOLEAN or :BOOLEAN | Boolean, accepts \"true\" \"t\" \"on\" \"false\"
BOOLEAN or :BOOLEAN | Boolean, accepts \"true\" \"t\" \"on\" \"false\"
| \"off\" \"nil\" and empty string
------------------------|------------------------------------------------------
STRING or :STRING | Value as-is after the equal sign in NAME = <value>
Expand All @@ -151,7 +152,7 @@ configurable from by property file configurator. See also
PROPERTY-INITARG-FROM-STRING"))

(defgeneric appender-do-flush (appender time)
(:documentation
(:documentation
"Perform any flushes of appender output if needed, marking the that
output was performed at time TIME. This function can be called from
any thread and should take care of serializing")
Expand Down
7 changes: 3 additions & 4 deletions src/appender.lisp → src/appender/appender.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,8 @@ time of the flush with TIME"
(all-appenders all-hierarchies))))

(defun save-all-appenders (&optional (all-hierarchies t))
"Flush any appenders that had output since being flushed"
(map nil (lambda (x) (save-appender x))
(all-appenders all-hierarchies)))
"Save all appenders, that is, clean up all resources."
(map nil #'save-appender (all-appenders all-hierarchies)))

(defmethod appender-do-append :around
((this serialized-appender) logger level log-func)
Expand All @@ -262,7 +261,7 @@ time of the flush with TIME"
;; Save one generic function dispatch by accessing STREAM slot directly
(defmethod appender-do-append ((this fixed-stream-appender-base)
logger
level
level
log-func)
(with-slots (layout stream %output-since-flush) this
(layout-to-stream layout stream logger level log-func)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/pattern-layout.lisp → src/appender/pattern-layout.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,13 @@ unchanged"
start-depth end-depth)))
(values))

(declaim (inline adjusted-logger-depth))

(defun adjusted-logger-depth (logger)
(if (typep logger 'source-file-logger)
(1- (logger-depth logger))
(logger-depth logger)))

(declaim (inline adjusted-logger-depth))

(define-pattern-formatter (#\c)
"Format the %c (full log category) pattern"
(declare (ignore log-level log-func))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3037934

Please sign in to comment.