Skip to content

Commit ac2cb60

Browse files
author
AP Ljungquist
authored
feat(acap-logging): Make env_logger optional and remove syslog (#185)
The reason is to make the cost in terms of storage smaller because this is a utility that most applications would use and the cost adds up if many applications are installed at the same time. Using the app profile, the size of hello_world is: - 387K (before) - 323K (after, with default features. `size` total is 323,436) - 323K (after, without default features. `size` total is 286,169) For reference the size of a no-op application compiled with the same settings is 263K. These are all numbers for aarch64-unknown-linux-gnu. Why the size as reported by `du` and `wc` does not decrease when I expect it to is a mystery to me, but it's not a rabbit hole I want to explore further at this time. One bonus benefit of this change is that the device information will no longer be duplicated in the syslog. I.e. it will say: > May 02 17:17:38 abc hello_world[20894]: Logging initialized instead of: > May 02 17:17:38 abc hello_world[20894]: abc hello_world[20894]: Logging initialized --- `apps/*/Cargo.toml`: - Enable `acap-logging/default` features to maintain the ability to run the apps interactively. - Propagate the `acap-logging/default` feature to make it possible to compile `hello_world` with tty support, as one would during development, and without it, as one would when deploying the app to production. This serves to document one way in which this can be achieved and also to make it easier to test that it works as expected (see `docs/manual-tests.md`). `apps/reverse_proxy/Cargo.toml`, `crates/axparameter/Cargo.toml`: - Remove `syslog` and `log` because they were not used and `syslog` should not be used. `crates/acap-logging/Cargo.toml`: - Bump the version to make these improvement instantly releasable because they are meaningful and it is unclear when the next improvements to the crate would be made. `docs/manual-tests.md`: - Added to start documenting some of the use cases that the apps and tools have been designed for because it can be difficult to remember and new contributors don't even have the chance to remember. I view this as an experiment and may change the approach to documentation or go back to relying on git logs.
1 parent c371b87 commit ac2cb60

File tree

19 files changed

+196
-178
lines changed

19 files changed

+196
-178
lines changed

Cargo.lock

Lines changed: 88 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ glib = "0.20.9"
2424
glib-sys = "0.20.9"
2525
glob = "0.3.1"
2626
libc = "0.2.153"
27+
libsyslog = "0.1.1"
2728
log = "0.4.22"
2829
pkg-config = "0.3.30"
2930
regex = "1.7.2"
@@ -32,7 +33,6 @@ reqwest-websocket = "0.4.1"
3233
semver = "1.0.23"
3334
serde = "1.0.204"
3435
serde_json = "1.0.120"
35-
syslog = "6.1.1"
3636
tar = "0.4.40"
3737
tempdir = "0.3.7"
3838
tempfile = "3.10.1"
@@ -44,7 +44,7 @@ tracing-subscriber = "0.3.18"
4444
url = "2.5.2"
4545

4646
acap-build = { path = "crates/acap-build" }
47-
acap-logging = { path = "crates/acap-logging" }
47+
acap-logging = { path = "crates/acap-logging", default-features = false }
4848
acap-ssh-utils = { path = "crates/acap-ssh-utils" }
4949
acap-vapix = { path = "crates/acap-vapix" }
5050
axevent = { path = "crates/axevent" }

apps-aarch64.checksum

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
2307f06b6728658c1e0d6d9251e3fbd22f209b9d target-aarch64/acap/Challenge_Build_Tools_1_0_0_all.eap
2-
af60683f2d875b37e6ff8e4bbb28c78b21b05013 target-aarch64/acap/axparameter_example_0_0_0_aarch64.eap
3-
650b6a80dc4ebba5cbaec7fb9e38135cd4c82bfa target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap
4-
0af03d5bec50d42ec579cb07360dad4e25c413ea target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap
5-
911a4cbf2cc7a67590488195bfdd87fb205ce73c target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap
2+
db7ab42f035a7eae0b5a82eb7ec9cc5d0584a8cc target-aarch64/acap/axparameter_example_0_0_0_aarch64.eap
3+
bd570bf0158fddfd9bc741099c87a1a14ffe788f target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap
4+
dd15c890a3fb8fb38c5ce2e8364f215ff1eb8610 target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap
5+
dfd925c003c30164c00dfc51676b6e1317a0fa6d target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap
66
16310c12bb50db85d69c744d13c93ebf0c628953 target-aarch64/acap/embedded_web_page_0_0_0_aarch64.eap
7-
46e8c7814f066c076a2d7a05f044548670672d4e target-aarch64/acap/event_subscribe_1_0_0_aarch64.eap
8-
f79353594a90130cec6226583fff68e56fd5c1ec target-aarch64/acap/hello_world_0_0_0_aarch64.eap
9-
6c96005d12ca0077de6c82aeb20cfe1e915e6a0e target-aarch64/acap/inspect_env_0_0_0_aarch64.eap
10-
ac57232da6402933012e506ac9dc08d94a5fe90b target-aarch64/acap/licensekey_handler_0_0_0_aarch64.eap
11-
0db9eaa42746e94de7ccfcd5a0fc078da6fe1412 target-aarch64/acap/reverse_proxy_0_0_0_aarch64.eap
12-
e5a389a499727973ccd401b4c16f5eddd928cb02 target-aarch64/acap/send_event_1_0_0_aarch64.eap
7+
148ad07bd1c5d213ae055c0f7050de454d6cb939 target-aarch64/acap/event_subscribe_1_0_0_aarch64.eap
8+
5712d955c8ea45a774597a6032a16af72a24e118 target-aarch64/acap/hello_world_0_0_0_aarch64.eap
9+
222f821339cf36e88596d85427740de3536573bf target-aarch64/acap/inspect_env_0_0_0_aarch64.eap
10+
74d6106b8f0afe7e3342ae3b470d8b81e7aa5150 target-aarch64/acap/licensekey_handler_0_0_0_aarch64.eap
11+
5dc0969dcbe6ca09aabcef9530a0f77786932b22 target-aarch64/acap/reverse_proxy_0_0_0_aarch64.eap
12+
c94b3ba49a3897617dc13599ffbc0642681133e5 target-aarch64/acap/send_event_1_0_0_aarch64.eap
1313
9df8dead66b245aa19d3aafa758871118b8cc25f target-aarch64/acap/using_a_build_script_0_0_0_aarch64.eap
14-
35971d17919db34bb275057fef80b0e8cd13484f target-aarch64/acap/vapix_access_0_0_0_aarch64.eap
14+
e1edf29b82e9c04c044309f63571e8898fcfe1f6 target-aarch64/acap/vapix_access_0_0_0_aarch64.eap

apps-aarch64.filesize

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
899 target-aarch64/acap/Challenge_Build_Tools_1_0_0_all.eap
2-
3414 target-aarch64/acap/axparameter_example_0_0_0_aarch64.eap
3-
3484 target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap
4-
2132 target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap
5-
2020 target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap
2+
2862 target-aarch64/acap/axparameter_example_0_0_0_aarch64.eap
3+
2937 target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap
4+
1598 target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap
5+
1480 target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap
66
899 target-aarch64/acap/embedded_web_page_0_0_0_aarch64.eap
7-
4077 target-aarch64/acap/event_subscribe_1_0_0_aarch64.eap
8-
1948 target-aarch64/acap/hello_world_0_0_0_aarch64.eap
9-
1982 target-aarch64/acap/inspect_env_0_0_0_aarch64.eap
10-
1970 target-aarch64/acap/licensekey_handler_0_0_0_aarch64.eap
11-
10911 target-aarch64/acap/reverse_proxy_0_0_0_aarch64.eap
12-
3982 target-aarch64/acap/send_event_1_0_0_aarch64.eap
7+
3525 target-aarch64/acap/event_subscribe_1_0_0_aarch64.eap
8+
1406 target-aarch64/acap/hello_world_0_0_0_aarch64.eap
9+
1441 target-aarch64/acap/inspect_env_0_0_0_aarch64.eap
10+
1430 target-aarch64/acap/licensekey_handler_0_0_0_aarch64.eap
11+
10362 target-aarch64/acap/reverse_proxy_0_0_0_aarch64.eap
12+
3430 target-aarch64/acap/send_event_1_0_0_aarch64.eap
1313
899 target-aarch64/acap/using_a_build_script_0_0_0_aarch64.eap
14-
11914 target-aarch64/acap/vapix_access_0_0_0_aarch64.eap
14+
11379 target-aarch64/acap/vapix_access_0_0_0_aarch64.eap

apps/axparameter_example/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ log = { workspace = true }
1010

1111
acap-logging = { workspace = true }
1212
axparameter = { workspace = true }
13+
14+
[features]
15+
default = ["acap-logging/default"]

apps/axstorage_example/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ log = { workspace = true }
1212
acap-logging = { workspace = true }
1313
axstorage = { workspace = true }
1414
libc = "0.2.158"
15+
16+
[features]
17+
default = ["acap-logging/default"]

apps/bounding_box_example/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ log = { workspace = true }
1010

1111
acap-logging = { workspace = true }
1212
bbox = { workspace = true }
13+
14+
[features]
15+
default = ["acap-logging/default"]

apps/consume_analytics_metadata/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ log = { workspace = true }
1010

1111
acap-logging = { workspace = true }
1212
mdb = { workspace = true }
13+
14+
[features]
15+
default = ["acap-logging/default"]

apps/event_subscribe/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ log = { workspace = true }
1212
acap-logging = { workspace = true }
1313
axevent = { workspace = true, features=["async"] }
1414
futures-lite = "2.6.0"
15+
16+
[features]
17+
default = ["acap-logging/default"]

apps/hello_world/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ publish = false
88
log = { workspace = true }
99

1010
acap-logging = { workspace = true }
11+
12+
[features]
13+
default = ["acap-logging/default"]

0 commit comments

Comments
 (0)