Sean Luchen
c3907b4c4a
Add LogSink & LogMessage classes for a more robust sink solution.
...
Signed-off-by: Sean Luchen <seanluchen@google.com>
2025-10-03 11:20:17 -07:00
Sean Luchen
8ce48ca81e
Logging: Add log stream that only get sent warning+ logs.
2025-10-03 08:55:54 -07:00
Jannis Harder
e546f3b8f0
Merge pull request #5355 from rocallahan/deprecate-logv_file_error
...
Deprecate `logv_file_error()`
2025-09-22 14:23:55 +02:00
Mohamed Gaber
1fa5ceee8c
pyosys: restore remaining log functions
...
Co-authored-by: George Rennie <19538554+georgerennie@users.noreply.github.com>
2025-09-20 16:14:07 +01:00
Robert O'Callahan
64ffcbc394
Deprecate logv_file_error()
2025-09-16 23:26:38 +00:00
Robert O'Callahan
8492c49f6c
Remove string_buf
by making log_signal()
and log_const()
return std::string
...
We only have to fix one caller in-tree so this probably has very low impact on out-of-tree plugins.
Resolves #5215
2025-09-16 03:06:17 +00:00
Jannis Harder
b87a33d64e
Merge pull request #5211 from rocallahan/remove-log_str
...
Remove `log_str()` functions and convert their `log_signal()` users t…
2025-09-12 14:10:47 +02:00
Robert O'Callahan
e0ae7b7af4
Remove .c_str() calls from log()/log_error()
...
There are some leftovers, but this is an easy regex-based approach that removes most of them.
2025-09-11 20:59:37 +00:00
Robert O'Callahan
c7017f7f79
Remove log_str()
functions and convert their log_signal()
users to return std::string
...
This is a small but easy step towards removing the `log_id_cache`.
See issue #5210 .
2025-09-11 04:00:49 +00:00
Robert O'Callahan
a137d03c32
Make log_cmd_error() use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
243f5f5201
Make log_file_error() use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
974455378b
Make log_error() use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
c3924d0616
Move log_abort()'s call to log_error() into an out-of-line non-varargs function
2025-09-09 15:41:03 +02:00
Robert O'Callahan
1b5373de0d
Move log_assert_worker()'s call to log_error() into an out-of-line non-varags function
2025-09-09 15:41:03 +02:00
Robert O'Callahan
ea2bb5b79a
Make log_file_info() use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
ec5f62e6d4
Make log_file_warning() use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
2a2c586e2c
Make log_experimental() just take an std::string, since it doesn't need to be varargs.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
25cba6181e
Make log_warning()/log_warning_noprefix() use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
66d2c2af08
Make log_header()
use variadic templates.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
d34ac0c87d
Make log()
use the FmtString
infrastructure.
...
Now `log()` supports `std::string`.
We have to fix a few places where the format parameter was not a compile time constant.
This is mostly trivial.
2025-09-09 15:41:03 +02:00
Robert O'Callahan
3f69a768f4
Hide public logv_
variant declarations that don't need to be public
2025-09-09 15:41:03 +02:00
Emil J. Tywoniak
41107e5473
log: add -expect types prefix-log, prefix-warning, prefix-error
2025-06-16 21:26:08 +02:00
Emil J. Tywoniak
a16227b209
Revert "Change the implementation of log_debug in kernel/log.h from a macro function to a normal function."
...
This reverts commit 15cfce061a
.
2025-06-06 15:14:40 +02:00
RonxBulld
15cfce061a
Change the implementation of log_debug in kernel/log.h from a macro function to a normal function.
2025-04-29 22:43:10 +08:00
Emil J. Tywoniak
d071489ab1
hashlib: redo interface for flexibility
2024-12-18 14:49:25 +01:00
Jannis Harder
c73c8a39cf
kernel/log: Add log_str helper for custom log_* functions/overloads
...
When implementing custom log_... functions or custom overloads for the
core log functions like log_signal it is necessary to return `char *`
that are valid long enough.
The log_... functions implemented in log.cc use either `log_id_cache` or
`string_buf` which both are cleared on log_pop.
This commit adds a public `log_str` function which stores its argument
in the `log_id_cache` and returns the stored copy, such that custom
log functions outside of log.cc can also create strings that remain
valid until the next `log_pop`.
2024-08-21 10:58:39 +01:00
Jannis Harder
d8687e87b1
kernel: Avoid including files outside include guards
...
This adjusts the way the headers kernel/{yosys,rtlil,register,log}.h
include each other to avoid the need of including headers outside of
include guards as well as avoiding the inclusion of rtlil.h in the
middle of yosys.h with rtlil.h depending on the prefix of yosys.h, and
the suffix of yosys.h depending on rtlil.h.
To do this I moved some of the declaration in yosys.h into a new header
yosys_common.h. I'm not sure if that is strictly necessary.
Including any of these files still results in the declarations of all
these headers being included, so this shouldn't be a breaking change for
any passes or external plugins.
My main motivation for this is that ccls's (clang based language server)
include guard handling gets confused by the previous way the includes
were done. It often ends up treating the include guard as a generic
disabled preprocessor conditional, breaking navigation and highlighting
for the core RTLIL data structures.
Additionally I think avoiding cyclic includes in the middle of header
files that depend on includes being outside of include guards will also
be less confusing for developers reading the code, not only for tools
like ccls.
2024-04-02 16:53:56 +02:00
Miodrag Milanovic
4eb18e1f07
change verific log callback api
2023-11-01 08:13:27 +01:00
Martin Povišer
77d4b5230e
ast: Move to a new helper method to print input errors
...
It's a repeating pattern to print an error message tied to an AST
node. Start using an 'input_error' helper for that. Among other
things this is beneficial in shortening the print lines, which tend
to be long.
2023-07-20 23:40:19 -04:00
Miodrag Milanovic
75cf79588e
Add ability for user plugin to add new verific log callback
2023-06-12 10:01:01 +02:00
Miodrag Milanovic
5801152779
Deprecate gcc-4.8
2023-01-11 09:54:19 +01:00
Jannis Harder
ed02d52f30
tee: Allow logging command output to a given scratchpad value
2022-12-02 14:36:19 +01:00
Claire Xenia Wolf
fe438ca1ab
Add missing log_dump_val_worker forward declarations
...
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2022-10-30 18:57:50 +01:00
Claire Xenia Wolf
be1a12595a
Add missing log_dump handler for std::vector<>
...
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2022-10-20 13:50:25 +02:00
Marcelina Kościelnicka
a681904237
Assorted microoptimization speedups in core data structures.
2022-07-27 17:05:30 +02:00
Claire Xenia Wolf
72787f52fc
Fixing old e-mail addresses and deadnames
...
s/((Claire|Xen|Xenia|Clifford)\s+)+(Wolf|Xen)\s+<(claire|clifford)@(symbioticeda.com|clifford.at|yosyshq.com)>/Claire Xenia Wolf <claire@yosyshq.com>/gi;
s/((Nina|Nak|N\.)\s+)+Engelhardt\s+<nak@(symbioticeda.com|yosyshq.com)>/N. Engelhardt <nak@yosyshq.com>/gi;
s/((David)\s+)+Shah\s+<(dave|david)@(symbioticeda.com|yosyshq.com|ds0.me)>/David Shah <dave@ds0.me>/gi;
s/((Miodrag)\s+)+Milanovic\s+<(miodrag|micko)@(symbioticeda.com|yosyshq.com)>/Miodrag Milanovic <micko@yosyshq.com>/gi;
s,https?://www.clifford.at/yosys/,http://yosyshq.net/yosys/,g ;
2021-06-08 00:39:36 +02:00
Michael Singer
d05d47cc04
Fix check for bad std::regex ( fixes #2606 )
2021-03-17 23:35:26 +01:00
clairexen
c7d71f436d
Merge pull request #2168 from whitequark/assert-unused-exprs
...
Use (and ignore) the expression provided to log_assert in NDEBUG builds
2020-06-25 18:21:51 +02:00
Alberto Gonzalez
28c2dd470b
log: Remove unused _POSIX_TIMERS
branch in PerformanceTimer::query()
.
2020-06-21 02:16:52 +00:00
Alberto Gonzalez
a564cc806f
log, qbfsat: Include child process time in PerformanceTimer::query()
and report the time for each call to the QBF-SAT solver.
2020-06-21 02:16:52 +00:00
whitequark
118e4caa37
Remove YS_ATTRIBUTE(unused) where present just for log_assert()/log_debug().
2020-06-19 15:48:58 +00:00
whitequark
21692c4a2e
Use (and ignore) the expression provided to log_debug in NDEBUG builds.
2020-06-19 15:48:58 +00:00
whitequark
2ffdb74fb1
Use (and ignore) the expression provided to log_assert in NDEBUG builds.
...
This avoids warnings in NDEBUG builds emitted when a variable is only
used in log_assert, but is always defined.
2020-06-19 15:48:58 +00:00
Xiretza
817411044a
Add missing [[noreturn]] to log_file_error()
...
Previously this was tagged only with YS_ATTRIBUTE(noreturn), but not
YS_NORETURN, so it got lost in #2173 , resulting in warnings in
frontends/ast/simplify.cc:
frontends/ast/simplify.cc:267:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
frontends/ast/simplify.cc:379:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
2020-06-19 11:46:06 +02:00
whitequark
60478a8e3a
Use C++11 [[noreturn]] attribute.
2020-06-19 01:06:48 +00:00
whitequark
7137f99658
kernel: guard include of signal.h more precisely.
...
Upgrading to WASI SDK 11.0 caused the WASM build to fail because WASM
does not have signals. (Arguably Yosys was broken even before, it was
just broken silently.)
2020-06-13 22:37:04 +00:00
Miodrag Milanović
637650597b
Merge pull request #2059 from boqwxp/logger-vector-to-dict
...
log: Use `dict` instead of `std::vector<std::pair>` for `log_expect_{error, warning, log}` to better express the intent that each element is unique.
2020-05-21 15:36:30 +02:00
Alberto Gonzalez
8297afe925
log: Use dict
instead of std::vector<std::pair>
for log_expect_{error, warning, log}
to better express the intent that each element is unique.
2020-05-15 00:55:32 +00:00
Peter Crozier
495dcfc812
Consolidate Linux and Mac version of YS_DEBUGTRAP_IF_DEBUGGING.
2020-05-13 14:17:00 +01:00
Peter Crozier
3988f935b8
Extend YS_DEBUGTRAP to MacOS.
2020-05-13 13:11:49 +01:00