Skip to content

Commit b9c73f8

Browse files
author
Max Mikhanosha
committed
Updated docstrings that were lagging behind the changes
1 parent 8791344 commit b9c73f8

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/naming.lisp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ arguments to be passed to the format statement that will log the
6060
message.
6161
6262
When second value returned is NIL, then logging macro will not log any
63-
message but will rather expand into a non-nil value if logger is"))
63+
message but will rather expand into a non-NIL value if logging is
64+
enabled on that logger."))
6465

6566
(defgeneric resolve-default-logger-form (package env args)
6667
(:documentation "Is called by RESOLVE-LOGGER-FORM when logging macro
@@ -78,8 +79,8 @@ For CLOS method it is recommended that return value be a generic
7879
function name, followed by optional qualifier, and then followed by
7980
any non-T specializers, with EQL specializers flattened to their
8081
values, for example for the :AROUND method FOO with lambda list
81-
of ((OBJ1 BAR) (OPTION (EQL :BAZ)) OBJ3) the return value is
82-
recommended to be in the form of '(FOO AROUND BAR BAZ) "))
82+
of ((OBJ1 BAR) (OPTION (EQL :BAZ)) OBJ3) should strive to return
83+
'(FOO AROUND BAR BAZ) "))
8384

8485
#-(or sbcl)
8586
(defmethod enclosing-scope-block-name (package env)

src/pattern-layout.lisp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Following pattern characters are recognized:
9999
%D date-time in local time, extra arguments can contain a strftime pattern
100100
101101
%h hostname of the system (implementation dependent, obtained once
102-
when pattern is parsed, and cached
102+
when pattern is parsed, and cached
103103
104104
%t Current thread name
105105
@@ -108,7 +108,7 @@ Following pattern characters are recognized:
108108
%i Process id of the lisp process, implementation dependent.
109109
110110
%I Two spaces repeated *log-indent* times. Different padding string
111-
can be specified in an extra argument.
111+
can be specified in an extra argument.
112112
113113
%n OS-dependent newline sequence.
114114
@@ -258,7 +258,7 @@ Example: For the string {one}{}{three} will return the list (14
258258

259259
(defmethod parse-extra-args (fmt-info character pattern start)
260260
"Default method does not parse any extra arguments and returns INFO
261-
unchanged"
261+
unchanged"
262262
(declare (ignore character pattern))
263263
(values start fmt-info))
264264

@@ -424,7 +424,7 @@ Example: For the string {one}{}{three} will return the list (14
424424

425425
(defun compile-pattern-format (layout pattern)
426426
"Parses the pattern format and returns a function with lambda-list
427-
of \(STREAM STREAM LOG-LEVEL LOG-FUNC\) that when called will output
427+
of (STREAM LOGGER LOG-LEVEL LOG-FUNC) that when called will output
428428
the log message to the stream with the specified format."
429429
(let ((idx 0)
430430
(str (make-array 0 :element-type 'character
@@ -518,10 +518,10 @@ the log message to the stream with the specified format."
518518

519519
(defgeneric format-time (stream pattern universal-time utc-p)
520520
(:documentation "Prints UNIVERSAL-TIME to the STREAM according to
521-
strftime like PATTERN."))
521+
strftime like PATTERN."))
522522

523523
(defun format-log-date (stream fmt-info utc-p)
524-
"Output the %d or %D pattern"
524+
"Helper function to print either %d or %D (date/time) pattern"
525525
(declare (type pattern-date-format-info fmt-info))
526526
(with-slots (minlen maxlen date-format universal-time) fmt-info
527527
(let* ((ut (or universal-time (log-event-time))))
@@ -534,13 +534,13 @@ the log message to the stream with the specified format."
534534
(values))
535535

536536
(define-pattern-formatter (#\d)
537-
"Output the %d pattern"
537+
"Output the %d (UTC date/time) pattern"
538538
(declare (ignore logger log-level log-func))
539539
(format-log-date stream fmt-info t)
540540
(values))
541541

542542
(define-pattern-formatter (#\D)
543-
"Output the %D pattern"
543+
"Output the %D (local date/time) pattern"
544544
(declare (ignore logger log-level log-func))
545545
(format-log-date stream fmt-info nil)
546546
(values))
@@ -712,7 +712,12 @@ the log message to the stream with the specified format."
712712
(defclass pattern-newline-format-info (format-info)
713713
((width :initarg :width)
714714
(continue :initarg :continue))
715-
(:documentation "Extra formatting flags for %n pattern"))
715+
(:documentation "Extra formatting flags for %n pattern. Currently
716+
this is unused, but in the future it may be implemented so that
717+
newline will be conditional, if underlaying stream supports
718+
STREAM-LINE-COLUMN, so that instead of two-line pattern layout, we can
719+
use conditional newline only user message does not fit on current
720+
line"))
716721

717722
(defmethod parse-extra-args (fmt-info (char (eql #\n)) pattern start)
718723
(destructuring-bind (next-pos &optional width continue)
@@ -790,7 +795,7 @@ the log message to the stream with the specified format."
790795
:indent-string (or indent-string " ")))))
791796

792797
(define-pattern-formatter (#\I)
793-
"Output %i (process id) pattern"
798+
"Output %I (current WITH-LOG-INDENT) pattern"
794799
(declare (ignore logger log-level log-func))
795800
(let ((str (slot-value fmt-info 'indent-string)))
796801
(if (and (zerop (slot-value fmt-info 'minlen))

0 commit comments

Comments
 (0)