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

utl::log() now includes the MOTIS module name #31

Closed

Conversation

Lucas-C
Copy link
Contributor

@Lucas-C Lucas-C commented Jan 17, 2025

No description provided.

@felixguendling
Copy link
Member

I'm not sure what's the intention here?

Source file_name will probably not contain motis-* in practice?

I would also say that utl should stay general purpose in the way that it can be used outside of MOTIS context.

Side note: never use std::string if std::string_view is sufficient. std::string is an owning container that always allocates. It has "small string optimization" but I would rather not want to depend on it if it's not necessary. Maybe that's another point for the STYLE.md guide.

@Lucas-C
Copy link
Contributor Author

Lucas-C commented Jan 17, 2025

I'm not sure what's the intention here?

Source file_name will probably not contain motis-* in practice?

I would also say that utl should stay general purpose in the way that it can be used outside of MOTIS context.

First, my approach was wrong, based on the fact that the name of my local repo clone was motis-utl 🤦

Moreover, on second thought, I'm not sure if this is really useful.
I think we could firgure a way to retrieve the name of the parent directory before src or include in file_name, but it's probably not worth it.

Side note: never use std::string if std::string_view is sufficient. std::string is an owning container that always allocates. It has "small string optimization" but I would rather not want to depend on it if it's not necessary. Maybe that's another point for the STYLE.md guide.

Oh OK, good to know, thank you 👍

@Lucas-C Lucas-C closed this Jan 17, 2025
@felixguendling
Copy link
Member

I think we could firgure a way to retrieve the name of the parent directory

Yes, that could work. Maybe something for after all code bases have been moved to utl logging and OTEL is connected.

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.

2 participants