Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added cyber log saved directory #72

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

| Target | CI Status |
| ------------- | :-----:|
| Ubuntu18.04 x86-64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu18-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu18-v9.0.0-build.yaml) |
| Ubuntu20.04 x86-64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu20-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu20-v9.0.0-build.yaml) |
| Ubuntu22.04 x86-64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu22-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu22-v9.0.0-build.yaml) |
| Ubuntu24.04 x86-64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu24-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu24-v9.0.0-build.yaml) |
| Ubuntu latest x86-64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu-latest-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu-latest-v9.0.0-build.yaml) |
| Ubuntu18.04 x86_64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu18-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu18-v9.0.0-build.yaml) |
| Ubuntu20.04 x86_64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu20-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu20-v9.0.0-build.yaml) |
| Ubuntu22.04 x86_64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu22-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu22-v9.0.0-build.yaml) |
| Ubuntu24.04 x86_64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu24-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu24-v9.0.0-build.yaml) |
| Ubuntu latest x86_64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu-latest-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu-latest-v9.0.0-build.yaml) |
| Ubuntu18.04 arrch64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu18-arrch64-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu18-arrch64-v9.0.0-build.yaml) |
| Ubuntu20.04 arrch64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu20-arrch64-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu20-arrch64-v9.0.0-build.yaml) |
| Ubuntu22.04 arrch64 | [![build v9.0.0](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu22-arrch64-v9.0.0-build.yaml/badge.svg?branch=v9.0.0)](https://github.com/minhanghuang/CyberRT/actions/workflows/ubuntu22-arrch64-v9.0.0-build.yaml) |
Expand Down Expand Up @@ -82,6 +82,16 @@ cyber_launch start share/examples/common_component_example/common.launch
./cyber/examples/common_component_example/channel_test_writer
```

3. log directory(optional)

**The Cyber log storage path is similar to `ROS` and is saved in `~/.cyber/log`**

If you want to modify the log storage path, you can change the `GLOG_log_dir` environment variable as follows:

```shell
# export GLOG_log_dir=/path/to/cyber/log
```

## #4 Tools

1. channel
Expand Down
8 changes: 8 additions & 0 deletions setup.bash.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/bash

_SETUP_PATH=$(cd `dirname $BASH_SOURCE[0]`; pwd)
USER_HOME_DIR=$(getent passwd $USER | cut -d: -f6)

CYBERRT_PATH=$(dirname "$_SETUP_PATH")
BUILD_PATH=$_SETUP_PATH
Expand Down Expand Up @@ -34,6 +35,13 @@ for entry in "${mainboard_path}" \
export PATH="${entry}":$PATH
done

# create log dir
CYBER_LOG_DIR_PREFIX="$USER_HOME_DIR/.cyber/log"
if [ ! -d "$CYBER_LOG_DIR_PREFIX" ]; then
mkdir -p "$CYBER_LOG_DIR_PREFIX"
fi

export GLOG_log_dir="$CYBER_LOG_DIR_PREFIX"
export GLOG_alsologtostderr=1
export GLOG_colorlogtostderr=1
export GLOG_minloglevel=0
Expand Down
8 changes: 8 additions & 0 deletions setup.zsh.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/bash

_SETUP_PATH=$(cd `dirname $0`; pwd)
USER_HOME_DIR=$(getent passwd $USER | cut -d: -f6)

CYBERRT_PATH=$(dirname "$_SETUP_PATH") # CyberRT Path
BUILD_PATH=$_SETUP_PATH # build path
Expand Down Expand Up @@ -35,6 +36,13 @@ for entry in "${mainboard_path}" \
export PATH="${entry}":$PATH
done

# create log dir
CYBER_LOG_DIR_PREFIX="$USER_HOME_DIR/.cyber/log"
if [ ! -d "$CYBER_LOG_DIR_PREFIX" ]; then
mkdir -p "$CYBER_LOG_DIR_PREFIX"
fi

export GLOG_log_dir="$CYBER_LOG_DIR_PREFIX"
export GLOG_alsologtostderr=1
export GLOG_colorlogtostderr=1
export GLOG_minloglevel=0
Expand Down
Loading