Skip to content

Commit

Permalink
fix: set default log level to INFO
Browse files Browse the repository at this point in the history
As per open-telemetry#856

Signed-off-by: Naseem <[email protected]>
  • Loading branch information
Naseem committed Jul 24, 2020
1 parent da0fac5 commit 63c1640
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/opentelemetry-core/src/common/ConsoleLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { LogLevel } from './types';
import { getEnv } from '../platform';

export class ConsoleLogger implements Logger {
constructor(level: LogLevel = getEnv().OTEL_LOG_LEVEL || LogLevel.INFO) {
constructor(level: LogLevel = getEnv().OTEL_LOG_LEVEL) {
if (level >= LogLevel.DEBUG) {
this.debug = (...args) => {
console.debug(...args);
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry-core/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ENVIRONMENT_NUMBERS: Partial<keyof ENVIRONMENT>[] = [
*/
export const DEFAULT_ENVIRONMENT: Required<ENVIRONMENT> = {
OTEL_NO_PATCH_MODULES: '',
OTEL_LOG_LEVEL: LogLevel.ERROR,
OTEL_LOG_LEVEL: LogLevel.INFO,
OTEL_SAMPLING_PROBABILITY: 1,
};

Expand Down Expand Up @@ -85,7 +85,7 @@ export function parseEnvironment(values: ENVIRONMENT_MAP): ENVIRONMENT {
const logLevelString = value.toUpperCase() as LogLevelString
logLevel = LogLevel[logLevelString];
}
environment[key] = logLevel ?? LogLevel.ERROR;
environment[key] = logLevel || DEFAULT_ENVIRONMENT[key]
break;

default:
Expand Down

0 comments on commit 63c1640

Please sign in to comment.