Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
181 additions
and
146 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
docs/src/vue/components/pages/tutorials/logging/logging_to_files.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template lang="pug"> | ||
page-tutorial( | ||
:toc="toc" | ||
) | ||
div.row | ||
div.col | ||
hr | ||
h2-hash Before You Get Started | ||
ul | ||
list-item-download-source-code(:source_code_uri="$route.meta.source_code_uri") | ||
div.row | ||
div.col | ||
hr | ||
h2-hash Steps | ||
ol | ||
li Create your app file. | ||
code-block(:data="example_code.app") | ||
li Run your app. | ||
code-block(:data="example_code.run") | ||
li Check the terminal you used to start <code>app.ts</code>. The log messages in <code>HomeResource</code> will be written in the terminal. The other log messages come from the <code>Drash.Http.Server</code> class. | ||
code-block-slotted | ||
template(v-slot:title) /path/to/your/project/server.log | ||
template(v-slot:code) | ||
| 2019-04-20 02:54:13.467Z | INFO | Request received: GET / | ||
| 2019-04-20 02:54:13.468Z | DEBUG | Calling HomeResource.GET() method. | ||
| 2019-04-20 02:54:13.468Z | FATAL | This is a FATAL log message. | ||
| 2019-04-20 02:54:13.468Z | ERROR | This is an ERROR log message | ||
| 2019-04-20 02:54:13.468Z | WARN | This is a WARN log message | ||
| 2019-04-20 02:54:13.468Z | INFO | This is an INFO log message | ||
| 2019-04-20 02:54:13.468Z | DEBUG | This is a DEBUG log message | ||
| 2019-04-20 02:54:13.468Z | TRACE | This is a TRACE log message | ||
| 2019-04-20 02:54:13.468Z | INFO | Sending response. Content-Type: application/json. Status: 200 (OK). | ||
| 2019-04-20 02:54:13.485Z | DEBUG | /favicon.ico requested. | ||
| 2019-04-20 02:54:13.485Z | DEBUG | All future log messages for /favicon.ico will be muted. | ||
</template> | ||
|
||
<script> | ||
export const resource = { | ||
paths: ["/tutorials/logging/logging-to-files"], | ||
meta: { | ||
title: "Logging: Logging To Files", | ||
tutorial_title: "Logging To Files", | ||
source_code_uri: "/tutorials/logging/logging_to_files" | ||
} | ||
} | ||
export default { | ||
data() { | ||
return { | ||
example_code: this.$app_data.example_code['/docs/src/example_code/tutorials/logging_to_files'] | ||
}; | ||
}, | ||
} | ||
</script> |
60 changes: 60 additions & 0 deletions
60
docs/src/vue/components/pages/tutorials/logging/logging_to_the_terminal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template lang="pug"> | ||
page-tutorial( | ||
:toc="toc" | ||
) | ||
div.row | ||
div.col | ||
hr | ||
h2-hash Before You Get Started | ||
list-item-download-source-code(:source_code_uri="$route.meta.source_code_uri") | ||
div.row | ||
div.col | ||
hr | ||
h2-hash Steps | ||
ol | ||
li Create your app file. | ||
code-block(:data="example_code.app") | ||
li Run your app. | ||
code-block(:data="example_code.run") | ||
li Check the terminal you used to start <code>app.ts</code>. The log messages in <code>HomeResource</code> will be written in the terminal. The other log messages come from the <code>Drash.Http.Server</code> class. | ||
code-block-slotted | ||
template(v-slot:title) Terminal | ||
template(v-slot:code) | ||
| 2019-04-20 02:54:13.467Z | INFO | Request received: GET / | ||
| 2019-04-20 02:54:13.468Z | DEBUG | Calling HomeResource.GET() method. | ||
| 2019-04-20 02:54:13.468Z | FATAL | This is a FATAL log message. | ||
| 2019-04-20 02:54:13.468Z | ERROR | This is an ERROR log message | ||
| 2019-04-20 02:54:13.468Z | WARN | This is a WARN log message | ||
| 2019-04-20 02:54:13.468Z | INFO | This is an INFO log message | ||
| 2019-04-20 02:54:13.468Z | DEBUG | This is a DEBUG log message | ||
| 2019-04-20 02:54:13.468Z | TRACE | This is a TRACE log message | ||
| 2019-04-20 02:54:13.468Z | INFO | Sending response. Content-Type: application/json. Status: 200 (OK). | ||
| 2019-04-20 02:54:13.485Z | DEBUG | /favicon.ico requested. | ||
| 2019-04-20 02:54:13.485Z | DEBUG | All future log messages for /favicon.ico will be muted. | ||
</template> | ||
|
||
<script> | ||
export const resource = { | ||
paths: ["/tutorials/logging/logging-to-the-terminal"], | ||
meta: { | ||
title: "Logging: Logging To The Terminal", | ||
tutorial_title: "Logging To The Terminal", | ||
source_code_uri: "/tutorials/logging/logging_to_the_terminal" | ||
}, | ||
toc: { | ||
items: [ | ||
"Before You Get Started", | ||
"Steps", | ||
"Verification", | ||
] | ||
} | ||
} | ||
export default { | ||
data() { | ||
return { | ||
example_code: this.$app_data.example_code['/docs/src/example_code/tutorials/logging/logging_to_the_terminal'] | ||
}; | ||
}, | ||
} | ||
</script> |
59 changes: 59 additions & 0 deletions
59
docs/src/vue/components/pages/tutorials/logging/logging_using_log_from_deno_std.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template lang="pug"> | ||
page-tutorial-default | ||
div.row | ||
div.col | ||
hr | ||
h2#before-you-get-started Before You Get Started | ||
ul | ||
li <a href="https://github.com/denoland/deno_std" target="_BLANK">deno_std</a> has a <a href="https://github.com/denoland/deno_std/tree/master/log" target="_BLANK">Log</a> module that is readily available and you can use it as your logger of choice. | ||
li Drash uses deno_std v{{ $conf.deno_std_version }}. | ||
list-item-download-source-code(:source_code_uri="$route.meta.source_code_uri") | ||
div.row | ||
div.col | ||
hr | ||
h2#steps Steps | ||
ol | ||
li Create your app file. | ||
code-block(:data="example_code.app") | ||
div.row | ||
div.col | ||
hr | ||
ul | ||
li Run your app. | ||
code-block(:data="example_code.run") | ||
li Enter the following URL in your browser: | ||
code-block-slotted(:header="false") | ||
template(#code) | ||
| localhost:1337 | ||
li Check the terminal you started your app with and you should see the following output: | ||
code-block-slotted | ||
template(#title) Terminal | ||
template(#code) | ||
| Deno server started at localhost:1337. | ||
| | ||
| INFO Setting a response. | ||
</template> | ||
|
||
<script> | ||
export const resource = { | ||
paths: ["/tutorials/logging/logging-using-log-from-deno-std"], | ||
meta: { | ||
title: "Logging Using Log From deno_std", | ||
source_code_uri: "/tutorials/logging/logging_using_log_from_deno_std" | ||
} | ||
} | ||
export default { | ||
data() { | ||
return { | ||
example_code: this.$app_data.example_code['/docs/src/example_code/tutorials/logging/logging_using_log_from_deno_std'], | ||
toc: { | ||
items: [ | ||
"Before You Get Started", | ||
"Steps", | ||
] | ||
} | ||
}; | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
docs/src/vue/components/pages/tutorials/logging_to_the_terminal.vue
This file was deleted.
Oops, something went wrong.
66 changes: 0 additions & 66 deletions
66
docs/src/vue/components/pages/tutorials/logging_using_log_from_deno_std.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters