Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
feat(Platform Adoption): Integrate Pendo to Centreon (#10140)
Browse files Browse the repository at this point in the history
Refs: MON-10926
  • Loading branch information
jeremyjaouen authored and kduret committed Oct 22, 2021
1 parent d5be8b6 commit c90660d
Show file tree
Hide file tree
Showing 9 changed files with 702 additions and 227 deletions.
5 changes: 4 additions & 1 deletion config/packages/Centreon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,7 @@ services:

Centreon\Domain\Log\ContactForDebug:
class: Centreon\Domain\Log\ContactForDebug
arguments: ['%env(DEBUG_CONTACT)%']
arguments: ['%env(DEBUG_CONTACT)%']

Centreon\Domain\Log\LegacyLogger:
public: true
8 changes: 8 additions & 0 deletions doc/API/centreon-api-v21.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@ paths:
schema:
type: object
properties:
id:
type: integer
description: Contact ID
example: 1
name:
type: string
description: Name of the current user
Expand All @@ -740,6 +744,10 @@ paths:
nullable: true
description: Locale of the current user
example: en_US
is_admin:
type: boolean
description: If the current user is an administrator
example: true
useDeprecatedPages:
type: boolean
description: Indicates if user wants to use deprecated monitoring pages
Expand Down
1 change: 1 addition & 0 deletions src/Centreon/Application/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function getUserParameters(): View
$user = $this->getUser();

return $this->view([
'id' => $user->getId(),
'name' => $user->getName(),
'alias' => $user->getAlias(),
'email' => $user->getEmail(),
Expand Down
115 changes: 115 additions & 0 deletions src/Centreon/Domain/Log/LegacyLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

/*
* Copyright 2005 - 2021 Centreon (https://www.centreon.com/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : contact@centreon.com
*
*/
declare(strict_types=1);

namespace Centreon\Domain\Log;

use Psr\Log\LoggerInterface;
use Centreon\Domain\Log\LoggerTrait;

/**
* This class is designed to be used in legacy codebase to use a logger
*
* @package Centreon\Domain\Log
*/
class LegacyLogger implements LoggerInterface
{
use LoggerTrait {
emergency as traitEmergency;
alert as traitAlert;
critical as traitCritical;
error as traitError;
warning as traitWarning;
notice as traitNotice;
info as traitInfo;
debug as traitDebug;
log as traitLog;
}

public function emergency($message, array $context = [])
{
$this->traitEmergency($message, $context);
}

/**
* @inheritDoc
*/
public function alert($message, array $context = [])
{
$this->traitAlert($message, $context);
}

/**
* @inheritDoc
*/
public function critical($message, array $context = [])
{
$this->traitCritical($message, $context);
}

/**
* @inheritDoc
*/
public function error($message, array $context = [])
{
$this->traitError($message, $context);
}

/**
* @inheritDoc
*/
public function warning($message, array $context = [])
{
$this->traitWarning($message, $context);
}

/**
* @inheritDoc
*/
public function notice($message, array $context = [])
{
$this->traitNotice($message, $context);
}

/**
* @inheritDoc
*/
public function info($message, array $context = [])
{
$this->traitInfo($message, $context);
}

/**
* @inheritDoc
*/
public function debug($message, array $context = [])
{
$this->traitDebug($message, $context);
}

/**
* @inheritDoc
*/
public function log($level, $message, array $context = [])
{
$this->traitLog($level, $message, $context);
}
}
Loading

0 comments on commit c90660d

Please sign in to comment.