Skip to content

Commit

Permalink
feat: Added cyber log saved directory
Browse files Browse the repository at this point in the history
  • Loading branch information
minhanghuang committed Jul 27, 2024
1 parent 2af2a17 commit 78feebc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
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

0 comments on commit 78feebc

Please sign in to comment.