Skip to content

fix: Use dynamic log file name based on product name#885

Merged
dexhorthy merged 1 commit intohumanlayer:mainfrom
jeanduplessis:fix-log-file-path
Jan 7, 2026
Merged

fix: Use dynamic log file name based on product name#885
dexhorthy merged 1 commit intohumanlayer:mainfrom
jeanduplessis:fix-log-file-path

Conversation

@jeanduplessis
Copy link
Copy Markdown
Contributor

@jeanduplessis jeanduplessis commented Dec 3, 2025

What problem(s) was I solving?

Fixes incorrect log file path display in Settings for CodeLayer PRO and other build variants. Previously hardcoded to "codelayer.log", now dynamically uses the product name (e.g., "CodeLayer-Pro.log", "CodeLayer-Nightly.log").

Fixes #884

What user-facing changes did I ship?

No new user-facing changes.

How I implemented it

Changes Made

  1. Added new Rust command (humanlayer-wui/src-tauri/src/lib.rs:315-328):

    • Created get_log_file_name() command that dynamically returns the correct log file name based on the Tauri product name
    • In development mode: always returns codelayer.log
    • In production mode: returns {ProductName}.log (e.g., CodeLayer-Pro.log, CodeLayer-Nightly.log, or CodeLayer.log)
  2. Updated TypeScript code (humanlayer-wui/src/components/SettingsDialog.tsx:69-85):

    • Modified loadLogPath() function to call the new get_log_file_name command
    • Now dynamically constructs the full log path using the correct filename for each build variant
  3. Updated documentation (humanlayer-wui/CLAUDE.md:5-14):

    • Documented the correct log paths for all build variants (Standard, Nightly, and PRO)

How It Works

The fix leverages the fact that Tauri automatically uses the productName from the config as the log file name when file_name: None is set in the log plugin configuration. The new code:

  • Reads the product name from Tauri's config at runtime
  • Formats it as {ProductName}.log
  • Returns the correct filename for each build variant:
    • Standard: CodeLayer.log
    • Nightly: CodeLayer-Nightly.log
    • PRO: CodeLayer-Pro.log

How to verify it

Note

I'm not sure how to build a PRO version of CodeLayer locally to verify the fix. I did do a dev build locally to ensure that everything still worked.

Testing

  1. Built the dev version of CodeLayer
  2. Went to Settings
  3. Verified the log path shows: ~/Library/Logs/dev.humanlayer.wui.pro/codelayer.log
  4. Tested the "Copy last N lines" button to ensure it correctly reads from the log file
  • I have ensured make check test passes

I did get a failure on the daemon lint checks, but assume this was already present?

=== Running Checks ===


[hlyr] CLI tool checks:
  ✓ Format check passed
  ✓ Lint check passed
  ✓ Tests passed (3 test files)
  ✓ Build completed

[humanlayer-wui] Web UI checks:
  ✓ Format check passed
  ✓ Lint check passed
  ✓ Type checking passed
  ✓ Rust check passed
  ✓ Rust clippy passed

[hld] Daemon checks:
  Installing golangci-lint...
  ✓ Format check passed
  ✓ Vet check passed
  ✗ Lint check passed
api/integration_test.go:2:1: buildtag: +build line is no longer needed (govet)
// +build integration
^
daemon/daemon_conversation_integration_test.go:2:1: buildtag: +build line is no longer needed (govet)
// +build integration
^
daemon/daemon_degraded_test.go:2:1: buildtag: +build line is no longer needed (govet)
// +build integration
^
3 issues:
* govet: 3
make[2]: *** [check-quiet] Error 1
make[1]: *** [check] Error 2
make: *** [check-hld] Error 2

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

My dog Milo having his morning coffee.
milo_coffee


Important

Dynamic log file naming based on product name implemented in Rust and TypeScript, with documentation updates.

  • Behavior:
    • get_log_file_name() command in lib.rs dynamically returns log file name based on Tauri product name.
    • In development, returns codelayer.log; in production, returns {ProductName}.log.
  • TypeScript:
    • loadLogPath() in SettingsDialog.tsx updated to use get_log_file_name() for dynamic log path construction.
  • Documentation:
    • Updated CLAUDE.md to document log paths for Standard, Nightly, and PRO builds.

This description was created by Ellipsis for eab8a6b. You can customize this summary. It will automatically update as commits are pushed.

Fixes incorrect log file path display in Settings for CodeLayer PRO and
other build variants. Previously hardcoded to "codelayer.log", now
dynamically uses the product name (e.g., "CodeLayer-Pro.log",
"CodeLayer-Nightly.log").

- Add get_log_file_name() Tauri command to retrieve product-specific filename
- Update SettingsDialog to use dynamic log filename
- Update documentation with correct paths for all variants

Fixes humanlayer#884
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 3, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to eab8a6b in 49 seconds. Click for details.
  • Reviewed 73 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/CLAUDE.md:8
  • Draft comment:
    Documentation updated to include product-specific log file names. Ensure that the documented product names (e.g., 'CodeLayer-Pro') exactly match the productName used in production builds.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. humanlayer-wui/src-tauri/src/lib.rs:315
  • Draft comment:
    The new Tauri command 'get_log_file_name' correctly returns a dynamic log filename based on the build mode. Verify that the 'config.product_name' field is reliably populated in production.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. humanlayer-wui/src/components/SettingsDialog.tsx:69
  • Draft comment:
    The updated 'loadLogPath' function now dynamically retrieves the log file name. Consider refactoring to avoid duplicating the call to 'invoke("get_log_file_name")' in both try and catch blocks.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. humanlayer-wui/src/components/SettingsDialog.tsx:71
  • Draft comment:
    For better readability, consider using template literals when constructing the log path instead of string concatenation.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_fmuNhwjThpzG11xG

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@jeanduplessis
Copy link
Copy Markdown
Contributor Author

In hind-sight I wonder if having a unique name for the log file is needed. It seems like the build type is part of the directory path so simply having "codelayer.log" consistently for the file name should be enough? Unless there's a use case I'm not aware of for having a unique file name as well 🤷

@dexhorthy
Copy link
Copy Markdown
Contributor

@jeanduplessis its not 100% thought out, probably a consequence of moving fast 🙂 in either case will get this in once the build passes

@dexhorthy dexhorthy merged commit bdea199 into humanlayer:main Jan 7, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CodeLayer Pro log file path incorrect

3 participants