Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmendsenProject
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shaik Janipasha
AmendsenProject
Commits
358f8c79
Commit
358f8c79
authored
Jan 13, 2020
by
Verdan Mahmood
Committed by
Tamika Tannis
Jan 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds the option to customize the logging (#362)
parent
636a7379
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
__init__.py
amundsen_application/__init__.py
+7
-2
config.py
amundsen_application/config.py
+6
-0
setup.py
setup.py
+1
-1
No files found.
amundsen_application/__init__.py
View file @
358f8c79
import
ast
import
importlib
import
logging
import
logging.config
import
os
from
flask
import
Flask
...
...
@@ -41,8 +42,12 @@ def create_app(config_module_class: str, template_folder: str = None) -> Flask:
app
.
config
.
from_object
(
config_module_class
)
logging
.
basicConfig
(
format
=
app
.
config
.
get
(
'LOG_FORMAT'
),
datefmt
=
app
.
config
.
get
(
'LOG_DATE_FORMAT'
))
logging
.
getLogger
()
.
setLevel
(
app
.
config
.
get
(
'LOG_LEVEL'
))
if
app
.
config
.
get
(
'LOG_CONFIG_FILE'
):
logging
.
config
.
fileConfig
(
app
.
config
.
get
(
'LOG_CONFIG_FILE'
),
disable_existing_loggers
=
False
)
else
:
logging
.
basicConfig
(
format
=
app
.
config
.
get
(
'LOG_FORMAT'
),
datefmt
=
app
.
config
.
get
(
'LOG_DATE_FORMAT'
))
logging
.
getLogger
()
.
setLevel
(
app
.
config
.
get
(
'LOG_LEVEL'
))
logging
.
info
(
'Created app with config name {}'
.
format
(
config_module_class
))
logging
.
info
(
'Using metadata service at {}'
.
format
(
app
.
config
.
get
(
'METADATASERVICE_BASE'
)))
logging
.
info
(
'Using search service at {}'
.
format
(
app
.
config
.
get
(
'SEARCHSERVICE_BASE'
)))
...
...
amundsen_application/config.py
View file @
358f8c79
...
...
@@ -12,6 +12,12 @@ class Config:
+
'
%(threadName)
s) -
%(message)
s'
LOG_DATE_FORMAT
=
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S
%
z'
LOG_LEVEL
=
'INFO'
# Path to the logging configuration file to be used by `fileConfig()` method
# https://docs.python.org/3.7/library/logging.config.html#logging.config.fileConfig
# LOG_CONFIG_FILE = 'amundsen_application/logging.conf'
LOG_CONFIG_FILE
=
None
COLUMN_STAT_ORDER
=
None
# type: Dict[str, int]
UNEDITABLE_SCHEMAS
=
set
()
# type: Set[str]
...
...
setup.py
View file @
358f8c79
...
...
@@ -34,7 +34,7 @@ requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'r
with
open
(
requirements_path
)
as
requirements_file
:
requirements
=
requirements_file
.
readlines
()
__version__
=
'1.2.
0
'
__version__
=
'1.2.
1
'
setup
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment