일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 파이썬
- 백준
- PYTHON
- gs25
- leetcode
- Baekjoon
- SW Expert Academy
- programmers
- github
- 맥북
- Git
- 금융문자분석경진대회
- 데이콘
- Kaggle
- 프로그래머스 파이썬
- 자연어처리
- 프로그래머스
- 우분투
- 캐치카페
- AI 경진대회
- dacon
- ChatGPT
- 더현대서울 맛집
- ubuntu
- hackerrank
- 코로나19
- Real or Not? NLP with Disaster Tweets
- 편스토랑
- 편스토랑 우승상품
- Docker
- Today
- Total
목록
반응형
2020/12/17 (2)
솜씨좋은장씨
최근에 API를 만들면서 API 요청에 대한 로그를 남겨야하는 일이 있어 python의 logging을 활용하여 로그를 남기려고 코드를 작성하여 실행하였는데 로그를 찍으면 찍을 수록 중복되어 찍히는 로그가 점점 많아 졌습니다. 수정 전 코드 import os import logging import logging.handlers def request_log(query, subj, prop, top1_prop, elapsed_time): dir_path = "./log_data/kbqa" if not (os.path.isdir(dir_path)): os.makedirs(os.path.join(dir_path)) logger = logging.getLogger("kbqa_search") logger.setLe..
Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)*(nums[j]-1). Example 1: Input: nums = [3,4,5,2] Output: 12 Explanation: If you choose the indices i=1 and j=2 (indexed from 0), you will get the maximum value, that is, (nums[1]-1)*(nums[2]-1) = (4-1)*(5-1) = 3*4 = 12. Example 2: Input: nums = [1,5,4,5] Output: 1..