Skip to content

Commit

Permalink
reduce exessive logging
Browse files Browse the repository at this point in the history
Update sdn.cpp

Update rpi.yml

Update rpi.yml

Update rpi.yml

Update rpi.yml
  • Loading branch information
raphaelscholle committed Mar 3, 2025
1 parent 06c5214 commit 658e94b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: pguyot/arm-runner-action@98b8d5a3228f504a8bd54913ab1e23d70f369c6e
- uses: pguyot/arm-runner-action@v2
id: build_image
with:
base_image: raspios_lite:2023-05-03
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
fpm -a armhf -s dir -t deb -n libcamera-openhd -v 1.2.7 -C /opt/libcamera-openhd -p libcamera-openhd_VERSION_ARCH.deb --conflicts "libcamera-dev" --conflicts "libcamera0"
- name: Upload to Github
uses: 'actions/upload-artifact@v2'
uses: 'actions/upload-artifact@v4'
with:
name: "libcamera"
path: |
Expand Down
4 changes: 2 additions & 2 deletions src/ipa/rpi/controller/rpi/sdn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ char const *Sdn::name() const

int Sdn::read(const libcamera::YamlObject &params)
{
LOG(RPiSdn, Warning)
<< "Using legacy SDN tuning - please consider moving SDN inside rpi.denoise";
// LOG(RPiSdn, Warning)
// << "Using legacy SDN tuning - please consider moving SDN inside rpi.denoise";
deviation_ = params["deviation"].get<double>(3.2);
strength_ = params["strength"].get<double>(0.75);
return 0;
Expand Down
79 changes: 41 additions & 38 deletions src/libcamera/base/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,44 +625,47 @@ void Logger::parseLogFile()
*/
void Logger::parseLogLevels()
{
const char *debug = utils::secure_getenv("LIBCAMERA_LOG_LEVELS");
if (!debug)
return;

for (const char *pair = debug; *debug != '\0'; pair = debug) {
const char *comma = strchrnul(debug, ',');
size_t len = comma - pair;

/* Skip over the comma. */
debug = *comma == ',' ? comma + 1 : comma;

/* Skip to the next pair if the pair is empty. */
if (!len)
continue;

std::string category;
std::string level;

const char *colon = static_cast<const char *>(memchr(pair, ':', len));
if (!colon) {
/* 'x' is a shortcut for '*:x'. */
category = "*";
level = std::string(pair, len);
} else {
category = std::string(pair, colon - pair);
level = std::string(colon + 1, comma - colon - 1);
}

/* Both the category and the level must be specified. */
if (category.empty() || level.empty())
continue;

LogSeverity severity = parseLogLevel(level);
if (severity == LogInvalid)
continue;

levels_.push_back({ category, severity });
}
const char *debug = utils::secure_getenv("LIBCAMERA_LOG_LEVELS");
if (!debug) {
// If no environment variable is set, force all logs to ERROR
levels_.push_back({ "*", LogError });
return;
}

for (const char *pair = debug; *debug != '\0'; pair = debug) {
const char *comma = strchrnul(debug, ',');
size_t len = comma - pair;

/* Skip over the comma. */
debug = *comma == ',' ? comma + 1 : comma;

/* Skip to the next pair if the pair is empty. */
if (!len)
continue;

std::string category;
std::string level;

const char *colon = static_cast<const char *>(memchr(pair, ':', len));
if (!colon) {
/* 'x' is a shortcut for '*:x'. */
category = "*";
level = std::string(pair, len);
} else {
category = std::string(pair, colon - pair);
level = std::string(colon + 1, comma - colon - 1);
}

/* Both the category and the level must be specified. */
if (category.empty() || level.empty())
continue;

LogSeverity severity = parseLogLevel(level);
if (severity == LogInvalid)
continue;

levels_.push_back({ category, severity });
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/libcamera/ipa_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Span<const uint8_t> elfLoadSymbol(Span<const uint8_t> elf, const char *symbol)
}

if (targetSymbol == nullptr) {
LOG(IPAModule, Error) << "Symbol " << symbol << " not found";
// LOG(IPAModule, Error) << "Symbol " << symbol << " not found";
return {};
}

Expand Down Expand Up @@ -289,7 +289,7 @@ int IPAModule::loadIPAModuleInfo()

Span<const uint8_t> info = elfLoadSymbol(data, "ipaModuleInfo");
if (info.size() < sizeof(info_)) {
LOG(IPAModule, Error) << "IPA module has no valid info";
// LOG(IPAModule, Error) << "IPA module has no valid info";
return -EINVAL;
}

Expand Down

0 comments on commit 658e94b

Please sign in to comment.