-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
docs: add running and debugging pages #5335
Conversation
|
||
## Debug strings reference | ||
|
||
<table> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you create this table by hand? Can we automate this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we have any script to do it, so I checked modules one by one 😳 And I didn't include all of the debug strings in here, or the list would be extremely long... I only include those important (from my understanding) ones. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A shell script will do. Or monkey patch the debug function :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a script I just made:
#!/bin/bash
clear
FILE_EXTENSION=$1
SEARCH_TEXT=$2
echo ""
echo " Files with extension : '${FILE_EXTENSION}' "
echo " that contains text : '${SEARCH_TEXT}' : "
echo "----------------------------------------------"
echo ""
find . -name "${FILE_EXTENSION}" -exec grep -h "${SEARCH_TEXT}" {} +
echo ""
echo ""
# include file name and found search text
# find . -name "*.ts" -exec grep "debugFactory('loopback" {} +
# only show found search text
# find . -name "*.ts" -exec grep -h "debugFactory('loopback" {} +
Call
./find_files_with_text.sh "*.ts" "'loopback:"
If you want to see : filename searchText in the results, remove the -h
in the script.
Right now it outputs ONLY the found search text : searchText
Based on my search string above, I found:
Files with extension : '*.ts'
that contains text : ''loopback:' :
----------------------------------------------
const debug = require('debug')('loopback:benchmark');
const debug = debugFactory('loopback:cron');
const debug = debugFactory('loopback:multi-tenancy:strategy:query');
const debug = debugFactory('loopback:multi-tenancy:strategy:header');
const debug = debugFactory('loopback:multi-tenancy:strategy:host');
const debug = debugFactory('loopback:multi-tenancy:strategy:jwt');
const debug = debugFactory('loopback:multi-tenancy:action');
const debug = require('debug')('loopback:example:acl');
const debug = debugFactory('loopback:boot:lb3app');
const debug = debugFactory('loopback:repository:belongs-to-accessor');
const debug = debugFactory('loopback:repository:belongs-to-helpers');
const debug = debugFactory('loopback:repository:has-one-helpers');
const debug = debugFactory('loopback:repository:has-one-repository-factory');
const debug = debugFactory('loopback:repository:has-many-repository-factory');
const debug = debugFactory('loopback:repository:has-many-inclusion-resolver');
const debug = debugFactory('loopback:repository:has-many-helpers');
const debug = debugFactory('loopback:repository:relation-helpers');
export const RELATIONS_KEY = 'loopback:relations';
const debug = debugFactory('loopback:repository:mixin');
>('loopback:model');
>('loopback:model-properties');
>('loopback:model-and-properties');
const debug = debugFactory('loopback:context:binding');
const debug = debugFactory('loopback:context:invocation');
const debug = debugFactory('loopback:context:interceptor');
const debug = debugModule('loopback:context:resolver');
const debug = debugFactory('loopback:context:binding-inspector');
* const debug = debugFactory('loopback:context:application');
* return 'loopback:context:application';
if (this.constructor === Context) return 'loopback:context';
const debug = debugFactory('loopback:context:subscription');
expect(myCtx.debugFn.namespace).to.eql('loopback:context:mycontext');
const debug = debugModule('loopback:context:test');
const debug = debugFactory('loopback:context:interceptor-chain');
const debugSession = debugModule('loopback:context:resolver:session');
const debug = debugFactory('loopback:context:view');
const debug = debugFactory('loopback:core:lifecycle');
const debug = debugFactory('loopback:core:application');
const debugShutdown = debugFactory('loopback:core:application:shutdown');
const debugWarning = debugFactory('loopback:core:application:warning');
const debug = debugFactory('loopback:boot:booter-utils');
const debug = debugFactory('loopback:boot:base-artifact-booter');
const debug = debugFactory('loopback:boot:lifecycle-observer-booter');
const debug = debugFactory('loopback:boot:interceptor-booter');
const debug = debugFactory('loopback:boot:service-booter');
const debug = debugModule('loopback:boot:booter:application-metadata');
const debug = debugFactory('loopback:boot:model-api');
const debug = debugModule('loopback:boot:bootstrapper');
const debug = debugFactory('loopback:http-caching-proxy');
const debug = debugFactory('loopback:tsdocs');
const debug = debugFactory('loopback:tsdocs');
>('loopback:json-schema');
const debug = debugFactory('loopback:repository-json-schema:build-schema');
'loopback:openapi3:metadata:controller-spec:deprecated',
const debug = require('debug')('loopback:openapi3:metadata:requestbody');
const debug = debugModule('loopback:openapi:spec-enhancer');
const debug = debugModule('loopback:openapi:spec-enhancer');
const debug = debugModule('loopback:openapi:spec-enhancer');
const debug = require('debug')('loopback:openapi3:metadata:controller-spec');
const debug = debugFactory('loopback:repository-tests');
const debug = debugFactory('loopback:authorization:interceptor');
const debug = debugModule('loopback:metadata:decorator');
const debug = debugFactory('loopback:boot:crud-rest');
const debug = debugFactory('loopback:openapi:spec-enhancer:consolidate');
const debug = debugFactory('loopback:openapi:spec-enhancer:info');
const debug = debugModule('loopback:rest:body-parser');
const debug = debugModule('loopback:rest:body-parser');
const debug = debugFactory('loopback:rest:parser');
const debug = debugFactory('loopback:openapi:spec-enhancer');
const debug = require('debug')('loopback:rest:sequence');
const debug = debugFactory('loopback:rest:server');
const debug = debugModule('loopback:rest:coercion');
const debug = debugModule('loopback:rest:coercion');
const debug = debugModule('loopback:rest:ajv');
const debug = debugModule('loopback:rest:validation');
const debug = require('debug')('loopback:rest:router:trie');
const debug = debugFactory('loopback:rest:routing-table');
const debug = require('debug')('loopback:rest:router:regexp');
const debug = debugFactory('loopback:rest:controller-route');
but feel free to adjust the search string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!! I also found that some packages have different ways to define the string e.g @loopback:cli
😂 which I have no idea how to write a script for
docs/site/Running-debugging-apps.md
Outdated
|
||
``` | ||
$ cd myapp | ||
$ node . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not npm start
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add API Connect here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think so.
7210a99
to
5698f41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to be consistent to use npm start
instead. Other that that, the changes LGTM. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
## Using debug strings | ||
|
||
LoopBack has a number of built-in debug strings to help with debugging.Specify a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoopBack has a number of built-in debug strings to help with debugging.Specify a | |
LoopBack has a number of built-in debug strings to help with debugging. Specify a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, will fix it in #4846
Implements #4845
Include Most of the bug strings
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈