Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
a3e37294
Unverified
Commit
a3e37294
authored
6 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
Better logs
parent
05baa895
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/index.ts
+6
-5
6 additions, 5 deletions
src/index.ts
src/misc/logger.ts
+4
-4
4 additions, 4 deletions
src/misc/logger.ts
with
10 additions
and
9 deletions
src/index.ts
+
6
−
5
View file @
a3e37294
...
...
@@ -72,6 +72,9 @@ function main() {
async
function
masterMain
()
{
let
config
:
Config
;
bootLogger
.
info
(
'
Welcome to Misskey!
'
);
bootLogger
.
info
(
`Misskey v
${
pkg
.
version
}
`
,
true
);
try
{
// initialize app
config
=
await
init
();
...
...
@@ -133,8 +136,8 @@ function showEnvironment(): void {
logger
.
info
(
typeof
env
==
'
undefined
'
?
'
NODE_ENV is not set
'
:
`NODE_ENV:
${
env
}
`
);
if
(
env
!==
'
production
'
)
{
logger
.
warn
(
'
The environment is not in production mode
'
);
logger
.
warn
(
'
Do not use for production purpose
'
);
logger
.
warn
(
'
The environment is not in production mode
.
'
);
logger
.
warn
(
'
Do not use for production purpose
!
'
,
true
);
}
logger
.
info
(
`You
${
isRoot
()
?
''
:
'
do not
'
}
have root privileges`
);
...
...
@@ -144,8 +147,7 @@ function showEnvironment(): void {
* Init app
*/
async
function
init
():
Promise
<
Config
>
{
bootLogger
.
info
(
'
Welcome to Misskey!
'
);
bootLogger
.
info
(
`<<< Misskey v
${
pkg
.
version
}
>>>`
);
showEnvironment
();
const
nodejsLogger
=
bootLogger
.
createSubLogger
(
'
nodejs
'
);
...
...
@@ -157,7 +159,6 @@ async function init(): Promise<Config> {
}
await
showMachine
();
showEnvironment
();
const
configLogger
=
bootLogger
.
createSubLogger
(
'
config
'
);
let
config
;
...
...
This diff is collapsed.
Click to expand it.
src/misc/logger.ts
+
4
−
4
View file @
a3e37294
...
...
@@ -29,16 +29,16 @@ export default class Logger {
this
.
log
(
chalk
.
red
.
bold
(
'
ERROR
'
),
chalk
.
red
.
bold
(
message
.
toString
()));
}
public
warn
(
message
:
string
):
void
{
// 実行を継続できるが改善すべき状況で使う
this
.
log
(
chalk
.
yellow
.
bold
(
'
WARN
'
),
chalk
.
yellow
.
bold
(
message
));
public
warn
(
message
:
string
,
important
=
false
):
void
{
// 実行を継続できるが改善すべき状況で使う
this
.
log
(
chalk
.
yellow
.
bold
(
'
WARN
'
),
chalk
.
yellow
.
bold
(
message
)
,
important
);
}
public
succ
(
message
:
string
,
important
=
false
):
void
{
// 何かに成功した状況で使う
this
.
log
(
chalk
.
blue
.
green
(
'
DONE
'
),
chalk
.
green
.
bold
(
message
),
important
);
}
public
info
(
message
:
string
):
void
{
// それ以外
this
.
log
(
chalk
.
blue
.
bold
(
'
INFO
'
),
message
);
public
info
(
message
:
string
,
important
=
false
):
void
{
// それ以外
this
.
log
(
chalk
.
blue
.
bold
(
'
INFO
'
),
message
,
important
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment