Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
df7ec1cf
Commit
df7ec1cf
authored
Feb 17, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a way for log-format numbers to become more human readable.
parent
6437b817
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
NEWS
NEWS
+4
-2
log.c
log.c
+14
-3
rsyncd.conf.yo
rsyncd.conf.yo
+5
-0
No files found.
NEWS
View file @
df7ec1cf
...
...
@@ -16,8 +16,10 @@ Changes since 3.0.4:
control over what is output. Added an extra type of --progress output
using --info=progress2.
- Output numbers in 3-digit groups by default (e.g. 1,234,567). (See the
--human-readable option for a way to turn it off.)
- Output numbers in 3-digit groups by default (e.g. 1,234,567). See the
--human-readable option for a way to turn it off. See also the daemon's
"log format" parameter for a modifier that can request digit-grouping or
human-readable output in log escapes (including --out-format).
- Added a "T" (terabyte) category to the --human-readable size suffixes.
...
...
log.c
View file @
df7ec1cf
...
...
@@ -493,12 +493,21 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
buf
[
total
]
=
'\0'
;
for
(
p
=
buf
;
(
p
=
strchr
(
p
,
'%'
))
!=
NULL
;
)
{
int
humanize
=
0
;
s
=
p
++
;
c
=
fmt
+
1
;
while
(
*
p
==
'\''
)
{
humanize
++
;
p
++
;
}
if
(
*
p
==
'-'
)
*
c
++
=
*
p
++
;
while
(
isDigit
(
p
)
&&
c
-
fmt
<
(
int
)(
sizeof
fmt
)
-
8
)
*
c
++
=
*
p
++
;
while
(
*
p
==
'\''
)
{
humanize
++
;
p
++
;
}
if
(
!*
p
)
break
;
*
c
=
'\0'
;
...
...
@@ -522,7 +531,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
case
'l'
:
strlcat
(
fmt
,
"s"
,
sizeof
fmt
);
snprintf
(
buf2
,
sizeof
buf2
,
fmt
,
comma_num
(
F_LENGTH
(
file
)
));
do_big_num
(
F_LENGTH
(
file
),
humanize
,
NULL
));
n
=
buf2
;
break
;
case
'U'
:
...
...
@@ -639,7 +648,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
initial_stats
->
total_read
;
}
strlcat
(
fmt
,
"s"
,
sizeof
fmt
);
snprintf
(
buf2
,
sizeof
buf2
,
fmt
,
comma_num
(
b
));
snprintf
(
buf2
,
sizeof
buf2
,
fmt
,
do_big_num
(
b
,
humanize
,
NULL
));
n
=
buf2
;
break
;
case
'c'
:
...
...
@@ -651,7 +661,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
initial_stats
->
total_read
;
}
strlcat
(
fmt
,
"s"
,
sizeof
fmt
);
snprintf
(
buf2
,
sizeof
buf2
,
fmt
,
comma_num
(
b
));
snprintf
(
buf2
,
sizeof
buf2
,
fmt
,
do_big_num
(
b
,
humanize
,
NULL
));
n
=
buf2
;
break
;
case
'C'
:
...
...
rsyncd.conf.yo
View file @
df7ec1cf
...
...
@@ -524,6 +524,11 @@ The format is a text string containing embedded single-character escape
sequences prefixed with a percent (%) character. An optional numeric
field width may also be specified between the percent and the escape
letter (e.g. "bf(%-50n %8l %07p)").
In addition, one or more apostrophes may be specified prior to a numerical
escape to indicate that the numerical value should be made more human-readable.
The 3 supported levels are the same as for the bf(--human-readable)
command-line option, though the default is for human-readability to be off.
Each added apostrophe increases the level (e.g. "bf(%''l %'b %f)").
The default log format is "%o %h [%a] %m (%u) %f %l", and a "%t [%p] "
is always prefixed when using the "log file" parameter.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment