-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ctx logger overwrite in egg extend (#846)
- Loading branch information
1 parent
0051d07
commit a9d7a0d
Showing
10 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
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
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
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,13 @@ | ||
module.exports = { | ||
get baseDir() { | ||
return this.loader.baseDir; | ||
}, | ||
|
||
get appDir() { | ||
return this.loader.appDir; | ||
}, | ||
|
||
get webFramework() { | ||
return this.loader.framework; | ||
}, | ||
}; |
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
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
10 changes: 10 additions & 0 deletions
10
packages/web/test/fixtures/feature/base-app-set-ctx-logger/src/agent.ts
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,10 @@ | ||
import { Application } from 'egg'; | ||
import * as assert from 'assert'; | ||
import { join } from 'path'; | ||
|
||
module.exports = (app: Application) => { | ||
assert(app.baseDir === __dirname); | ||
assert((app as any).appDir === join(__dirname, '..')); | ||
assert((app as any).applicationContext); | ||
app.createAnonymousContext().logger.warn('aaaaa'); | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/web/test/fixtures/feature/base-app-set-ctx-logger/src/app.ts
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,10 @@ | ||
import * as assert from 'assert'; | ||
import { join } from 'path'; | ||
import { Application } from 'egg'; | ||
|
||
module.exports = (app: Application) => { | ||
assert(app.baseDir === __dirname); | ||
assert((app as any).appDir === join(__dirname, '..')); | ||
assert((app as any).applicationContext); | ||
app.createAnonymousContext().logger.warn('aaaaa'); | ||
} |
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
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
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