Skip to content

Commit 2338118

Browse files
committed
logroller: To avoid naming conflicts with logrotate, change the name to logroller
1 parent 5e85aa5 commit 2338118

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ sudo make install
123123

124124
## Extension tools
125125

126-
### logrotate
126+
### logroller
127127

128-
[logrotate](tools/logrotate) is a command-line tool for circularly writing the output of other programs to some files via a pipe ("|").
128+
[logroller](tools/logroller) is a command-line tool for circularly writing the output of other programs to some files via a pipe ("|").
129129

130130
It is written using ulog's asynchronous fifo and extended headers for file loop writing.
131131

132132
Usage:
133133

134134
```bash
135-
your_program | logrotate --file-path /tmp/example/log.txt --file-size=100000 --max-files=3
135+
your_program | logroller --file-path /tmp/example/log.txt --file-size=100000 --max-files=3
136136
```

Diff for: tools/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
add_subdirectory(logrotate)
1+
add_subdirectory(logroller)

Diff for: tools/logroller/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
add_executable(logroller logroller.cc cmdline.c)
2+
target_link_libraries(logroller ulog pthread zstd::libzstd_shared)

Diff for: tools/logrotate/README.md renamed to tools/logroller/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# logrotate
1+
# logroller
22

33
Loop logging of standard inputs to several files
44

@@ -9,10 +9,10 @@ Written using ulog's asynchronous fifo and extended headers for file loop writin
99
## Base Usage
1010

1111
```shell
12-
your_program | logrotate --file-path /tmp/example/log.txt --file-size=100KB --max-files=3
12+
your_program | logroller --file-path /tmp/example/log.txt --file-size=100KB --max-files=3
1313
```
1414

15-
This will output the output of your program to `/tmp/example/log.txt` through `logrotate`, and limit the size and number of a single file according to the options.
15+
This will output the output of your program to `/tmp/example/log.txt` through `logroller`, and limit the size and number of a single file according to the options.
1616

1717
Eventually there will be `log.3.txt, log.2.txt, log.1.txt, log.txt` in the `/tmp/example` directory.
1818

@@ -23,21 +23,21 @@ The `log.txt` can be viewed in real time using `tail -F /tmp/example/log.txt`.
2323
## Advanced Usage
2424

2525
```shell
26-
your_program | logrotate --file-path /tmp/example/log.txt --file-size=10MB --max-files=8 --flush-interval=3s --zstd-compress --zstd-params=level=3,window-log=16,chain-log=12,hash-log=13
26+
your_program | logroller --file-path /tmp/example/log.txt --file-size=10MB --max-files=8 --flush-interval=3s --zstd-compress --zstd-params=level=3,window-log=16,chain-log=12,hash-log=13
2727
```
2828

2929
Please refer to the following command line options for more advanced usage.
3030

3131
## Command line options
3232

3333
```bash
34-
> logrotate --help
35-
Usage: logrotate -f PATH [OPTIONS]...
34+
> logroller --help
35+
Usage: logroller -f PATH [OPTIONS]...
3636
Loop logging of standard inputs to several files.
3737

3838
Examples:
39-
your_program | logrotate --file-path=log.txt --file-size=1MB --max-files=8
40-
your_program | logrotate -f log.txt -s 1MB -n 8 --zstd-compress
39+
your_program | logroller --file-path=log.txt --file-size=1MB --max-files=8
40+
your_program | logroller -f log.txt -s 1MB -n 8 --zstd-compress
4141

4242
-h, --help Print help and exit
4343
-V, --version Print version and exit
@@ -70,4 +70,4 @@ The TIME parameter units are s, sec, ms, min, hour. If the unit is not
7070
specified, the default is seconds.
7171
```
7272
73-
Command line options are generated by the gnu [gengetopt](https://www.gnu.org/software/gengetopt) tool with `getopt`. `cmdline.c/h` files are generated by the `gengetopt < logrotate_getopt.ggo` command.
73+
Command line options are generated by the gnu [gengetopt](https://www.gnu.org/software/gengetopt) tool with `getopt`. `cmdline.c/h` files are generated by the `gengetopt < logroller_getopt.ggo` command.

Diff for: tools/logrotate/cmdline.c renamed to tools/logroller/cmdline.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
const char *gengetopt_args_info_purpose = "Loop logging of standard inputs to several files.";
2929

30-
const char *gengetopt_args_info_usage = "Usage: logrotate -f PATH [OPTIONS]...";
30+
const char *gengetopt_args_info_usage = "Usage: logroller -f PATH [OPTIONS]...";
3131

3232
const char *gengetopt_args_info_versiontext = "";
3333

34-
const char *gengetopt_args_info_description = "Examples:\n your_program | logrotate --file-path=log.txt --file-size=1MB --max-files=8\n your_program | logrotate -f log.txt -s 1MB -n 8 --zstd-compress";
34+
const char *gengetopt_args_info_description = "Examples:\n your_program | logroller --file-path=log.txt --file-size=1MB --max-files=8\n your_program | logroller -f log.txt -s 1MB -n 8 --zstd-compress";
3535

3636
const char *gengetopt_args_info_help[] = {
3737
" -h, --help Print help and exit",

Diff for: tools/logrotate/cmdline.h renamed to tools/logroller/cmdline.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ extern "C" {
2121

2222
#ifndef CMDLINE_PARSER_PACKAGE
2323
/** @brief the program name (used for printing errors) */
24-
#define CMDLINE_PARSER_PACKAGE "logrotate"
24+
#define CMDLINE_PARSER_PACKAGE "logroller"
2525
#endif
2626

2727
#ifndef CMDLINE_PARSER_PACKAGE_NAME
2828
/** @brief the complete program name (used for help and version) */
29-
#define CMDLINE_PARSER_PACKAGE_NAME "logrotate"
29+
#define CMDLINE_PARSER_PACKAGE_NAME "logroller"
3030
#endif
3131

3232
#ifndef CMDLINE_PARSER_VERSION
File renamed without changes.

Diff for: tools/logrotate/logrotate_getopt.ggo renamed to tools/logroller/logroller_getopt.ggo

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package "logrotate"
1+
package "logroller"
22
version "0.6.0"
33

4-
usage "logrotate -f PATH [OPTIONS]..."
4+
usage "logroller -f PATH [OPTIONS]..."
55
purpose "Loop logging of standard inputs to several files."
66
description "Examples:\n\
7-
your_program | logrotate --file-path=log.txt --file-size=1MB --max-files=8\n\
8-
your_program | logrotate -f log.txt -s 1MB -n 8 --zstd-compress"
7+
your_program | logroller --file-path=log.txt --file-size=1MB --max-files=8\n\
8+
your_program | logroller -f log.txt -s 1MB -n 8 --zstd-compress"
99

1010
section "File options"
1111
option "file-path" f "File path to record log"

Diff for: tools/logrotate/CMakeLists.txt

-2
This file was deleted.

0 commit comments

Comments
 (0)