Skip to content

Commit

Permalink
Update log.md (#4111)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?
<!---
Describe your changes and why you're making them. If linked to an open
issue or a pull request on dbt Core, then link to them here! 

To learn more about the writing conventions used in the dbt Labs docs,
see the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md).
-->
Source github URL currently brings me to the wrong place. Presumably
these line numbers will change anytime someone commits to this file, so
might need a better solution in the future to reference this code.
<img width="1004" alt="Screenshot 2023-09-22 at 10 28 16 AM"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/30663534/af3650ce-9c99-475c-8049-60f65159859f">

Change to L549-L566

## Checklist
<!--
Uncomment if you're publishing docs for a prerelease version of dbt
(delete if not applicable):
- [ ] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/guides/migration/versions)
-->
- [ ] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [ ] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

Adding new pages (delete if not applicable):
- [ ] Add page to `website/sidebars.js`
- [ ] Provide a unique filename for the new page

Removing or renaming existing pages (delete if not applicable):
- [ ] Remove page from `website/sidebars.js`
- [ ] Add an entry `website/static/_redirects`
- [ ] [Ran link
testing](https://github.com/dbt-labs/docs.getdbt.com#running-the-cypress-tests-locally)
to update the links that point to the deleted page
  • Loading branch information
mirnawong1 authored Sep 26, 2023
2 parents 868529a + da144a1 commit 0c7b0cc
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion website/docs/reference/dbt-jinja-functions/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,34 @@ __Args__:

Logs a line to either the log file or stdout.

([Source on GitHub](https://github.com/dbt-labs/dbt-core/blob/HEAD/core/dbt/context/base.py#L432))
<details>
<summary>Code source</summary>
Refer to <a href="https://github.com/dbt-labs/dbt-core/blob/HEAD/core/dbt/context/base.py#L549-L566">GitHub</a> or the following code as a source: <br /><br />

```python
def log(msg: str, info: bool = False) -> str:
"""Logs a line to either the log file or stdout.
:param msg: The message to log
:param info: If `False`, write to the log file. If `True`, write to
both the log file and stdout.
> macros/my_log_macro.sql
{% macro some_macro(arg1, arg2) %}
{{ log("Running some_macro: " ~ arg1 ~ ", " ~ arg2) }}
{% endmacro %}"
"""
if info:
fire_event(JinjaLogInfo(msg=msg, node_info=get_node_info()))
else:
fire_event(JinjaLogDebug(msg=msg, node_info=get_node_info()))
return ""
```



</details>

```sql

Expand Down

0 comments on commit 0c7b0cc

Please sign in to comment.